diff --git a/packages/typespec-powershell/src/convertor/convertor.ts b/packages/typespec-powershell/src/convertor/convertor.ts index 024173cc090..3855ab0d02c 100644 --- a/packages/typespec-powershell/src/convertor/convertor.ts +++ b/packages/typespec-powershell/src/convertor/convertor.ts @@ -68,6 +68,9 @@ function getSchemas(program: Program, client: SdkClient, psContext: SdkContext, schema.language.default.description = "Anything"; schemas["any"] = schemas["any"] || []; schemas["any"].push(schema); + } else if (schema.type === SchemaType.Dictionary && !schema.language) { + // skip anonymous dictionary schema + continue; } else { if (schema.type === SchemaType.Array && (schema).delayType) { (schema).elementType = getSchemaForType(psContext, (schema).delayType as Type); diff --git a/packages/typespec-powershell/src/utils/modelUtils.ts b/packages/typespec-powershell/src/utils/modelUtils.ts index 89b1bdaf2ba..bde63c58b76 100644 --- a/packages/typespec-powershell/src/utils/modelUtils.ts +++ b/packages/typespec-powershell/src/utils/modelUtils.ts @@ -222,6 +222,10 @@ export function getSchemaForType( propertySchema.language.default.description = getDoc(program, type) || ""; schemaCache.set(type, propertySchema); return propertySchema; + } else if (type.type.kind === "Model" && isRecordModelType(program, type.type) && type.type.name === "Record") { + const propertySchema = { ...typeSchema }; + schemaCache.set(type, propertySchema); + return propertySchema; } else { return typeSchema; } @@ -933,10 +937,10 @@ function getSchemaForModel( (propSchema).language = (propSchema).language || {}; (propSchema).language.default = (propSchema).language.default || {}; (propSchema).language.default.description = (propSchema).language.default.description || propertyDescription || ""; - (propSchema).language.default.name = (propSchema).language.default.name || name; + (propSchema).language.default.name = (propSchema).language.default.name || modelSchema.language.default.name + '-' + name; } // ToDo: need to confirm there is no duplicated properties. - const property = new Property(name, getDoc(program, prop) || "", propSchema || new ObjectSchema(name, "")); + const property = new Property(name, getDoc(program, prop) || propSchema.language.default.description || "", propSchema || new ObjectSchema(name, "")); if (!prop.optional) { property.required = true; } @@ -1315,8 +1319,12 @@ function getSchemaForRecordModel( schema = { type: "dictionary", elementType: valueType, - description: getDoc(program, type) + description: getDoc(program, type), }; + // If name is Record, it is an anonymous dict. And for anonymous dict, we will create schema in each used property and let `default` created later. + if (type.name !== "Record") { + schema.default = { name: type.name, description: getDoc(program, type) }; + } if ( !program.checker.isStdType(indexer.value) && !isUnknownType(indexer.value!) && diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 452f8f1aa89..8b29ee4a2d2 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResource.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResource.PowerShell.cs index 8df133bc410..190e4482445 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResource.PowerShell.cs @@ -155,18 +155,6 @@ internal ReportResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).StorageInfo = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IStorageInfo) content.GetValueForProperty("StorageInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).StorageInfo, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.StorageInfoTypeConverter.ConvertFrom); } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("CertRecord")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -183,10 +171,18 @@ internal ReportResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TimeZone, global::System.Convert.ToString); } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("TenantId")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TenantId, global::System.Convert.ToString); @@ -207,6 +203,10 @@ internal ReportResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Subscription = (System.Collections.Generic.List) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Subscription, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("CertRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); + } if (content.Contains("ComplianceStatusM365")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ComplianceStatusM365 = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IOverviewStatus) content.GetValueForProperty("ComplianceStatusM365",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ComplianceStatusM365, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.OverviewStatusTypeConverter.ConvertFrom); @@ -312,18 +312,6 @@ internal ReportResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).StorageInfo = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IStorageInfo) content.GetValueForProperty("StorageInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).StorageInfo, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.StorageInfoTypeConverter.ConvertFrom); } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("CertRecord")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -340,10 +328,18 @@ internal ReportResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TimeZone, global::System.Convert.ToString); } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("TenantId")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).TenantId, global::System.Convert.ToString); @@ -364,6 +360,10 @@ internal ReportResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Subscription = (System.Collections.Generic.List) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).Subscription, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("CertRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); + } if (content.Contains("ComplianceStatusM365")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ComplianceStatusM365 = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IOverviewStatus) content.GetValueForProperty("ComplianceStatusM365",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourceInternal)this).ComplianceStatusM365, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.OverviewStatusTypeConverter.ConvertFrom); diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResourcePatch.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResourcePatch.PowerShell.cs index 284b0e27a7a..88bfcc40730 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResourcePatch.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ReportResourcePatch.PowerShell.cs @@ -115,18 +115,6 @@ internal ReportResourcePatch(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).StorageInfo = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IStorageInfo) content.GetValueForProperty("StorageInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).StorageInfo, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.StorageInfoTypeConverter.ConvertFrom); } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("CertRecord")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -143,10 +131,18 @@ internal ReportResourcePatch(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TimeZone, global::System.Convert.ToString); } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("TenantId")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TenantId, global::System.Convert.ToString); @@ -167,6 +163,10 @@ internal ReportResourcePatch(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Subscription = (System.Collections.Generic.List) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Subscription, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("CertRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); + } if (content.Contains("ComplianceStatusM365")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ComplianceStatusM365 = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IOverviewStatus) content.GetValueForProperty("ComplianceStatusM365",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ComplianceStatusM365, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.OverviewStatusTypeConverter.ConvertFrom); @@ -232,18 +232,6 @@ internal ReportResourcePatch(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).StorageInfo = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IStorageInfo) content.GetValueForProperty("StorageInfo",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).StorageInfo, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.StorageInfoTypeConverter.ConvertFrom); } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("CertRecord")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -260,10 +248,18 @@ internal ReportResourcePatch(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TimeZone, global::System.Convert.ToString); } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource = (System.Collections.Generic.List) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Resource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ResourceMetadataTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Error, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("TenantId")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).TenantId, global::System.Convert.ToString); @@ -284,6 +280,10 @@ internal ReportResourcePatch(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Subscription = (System.Collections.Generic.List) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).Subscription, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("CertRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord = (System.Collections.Generic.List) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).CertRecord, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom)); + } if (content.Contains("ComplianceStatusM365")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ComplianceStatusM365 = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IOverviewStatus) content.GetValueForProperty("ComplianceStatusM365",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportResourcePatchInternal)this).ComplianceStatusM365, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.OverviewStatusTypeConverter.ConvertFrom); diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ScopingConfigurationResource.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ScopingConfigurationResource.PowerShell.cs index c84573c5ea8..6d9315cafe1 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ScopingConfigurationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/ScopingConfigurationResource.PowerShell.cs @@ -153,14 +153,14 @@ internal ScopingConfigurationResource(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Answer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer = (System.Collections.Generic.List) content.GetValueForProperty("Answer",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ScopingAnswerTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } + if (content.Contains("Answer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer = (System.Collections.Generic.List) content.GetValueForProperty("Answer",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ScopingAnswerTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -222,14 +222,14 @@ internal ScopingConfigurationResource(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Answer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer = (System.Collections.Generic.List) content.GetValueForProperty("Answer",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ScopingAnswerTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } + if (content.Contains("Answer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer = (System.Collections.Generic.List) content.GetValueForProperty("Answer",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IScopingConfigurationResourceInternal)this).Answer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ScopingAnswerTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SnapshotResource.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SnapshotResource.PowerShell.cs index e7ed71ea30c..e20473b9feb 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SnapshotResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SnapshotResource.PowerShell.cs @@ -155,10 +155,6 @@ internal SnapshotResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("ComplianceResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult = (System.Collections.Generic.List) content.GetValueForProperty("ComplianceResult",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ComplianceResultTypeConverter.ConvertFrom)); - } if (content.Contains("ReportProperty")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportProperty = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportProperties) content.GetValueForProperty("ReportProperty",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportProperty, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ReportPropertiesTypeConverter.ConvertFrom); @@ -175,6 +171,10 @@ internal SnapshotResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } + if (content.Contains("ComplianceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult = (System.Collections.Generic.List) content.GetValueForProperty("ComplianceResult",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ComplianceResultTypeConverter.ConvertFrom)); + } if (content.Contains("ReportSystemDataCreatedBy")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportSystemDataCreatedBy = (string) content.GetValueForProperty("ReportSystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportSystemDataCreatedBy, global::System.Convert.ToString); @@ -264,10 +264,6 @@ internal SnapshotResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("ComplianceResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult = (System.Collections.Generic.List) content.GetValueForProperty("ComplianceResult",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ComplianceResultTypeConverter.ConvertFrom)); - } if (content.Contains("ReportProperty")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportProperty = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IReportProperties) content.GetValueForProperty("ReportProperty",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportProperty, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ReportPropertiesTypeConverter.ConvertFrom); @@ -284,6 +280,10 @@ internal SnapshotResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } + if (content.Contains("ComplianceResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult = (System.Collections.Generic.List) content.GetValueForProperty("ComplianceResult",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ComplianceResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ComplianceResultTypeConverter.ConvertFrom)); + } if (content.Contains("ReportSystemDataCreatedBy")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportSystemDataCreatedBy = (string) content.GetValueForProperty("ReportSystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISnapshotResourceInternal)this).ReportSystemDataCreatedBy, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordRequest.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordRequest.PowerShell.cs index 7324603226f..d6d252ec1bf 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordRequest.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordRequest.PowerShell.cs @@ -111,10 +111,6 @@ internal SyncCertRecordRequest(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecord = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ICertSyncRecord) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecord, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom); } - if (content.Contains("CertRecordControl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("CertRecordOfferGuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordOfferGuid = (string) content.GetValueForProperty("CertRecordOfferGuid",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordOfferGuid, global::System.Convert.ToString); @@ -127,6 +123,10 @@ internal SyncCertRecordRequest(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordIngestionStatus = (string) content.GetValueForProperty("CertRecordIngestionStatus",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordIngestionStatus, global::System.Convert.ToString); } + if (content.Contains("CertRecordControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -148,10 +148,6 @@ internal SyncCertRecordRequest(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecord = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ICertSyncRecord) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecord, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom); } - if (content.Contains("CertRecordControl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("CertRecordOfferGuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordOfferGuid = (string) content.GetValueForProperty("CertRecordOfferGuid",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordOfferGuid, global::System.Convert.ToString); @@ -164,6 +160,10 @@ internal SyncCertRecordRequest(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordIngestionStatus = (string) content.GetValueForProperty("CertRecordIngestionStatus",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordIngestionStatus, global::System.Convert.ToString); } + if (content.Contains("CertRecordControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordRequestInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordResponse.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordResponse.PowerShell.cs index 1aa0d21f54d..74c6212b12a 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/SyncCertRecordResponse.PowerShell.cs @@ -111,10 +111,6 @@ internal SyncCertRecordResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecord = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ICertSyncRecord) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecord, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom); } - if (content.Contains("CertRecordControl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("CertRecordOfferGuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordOfferGuid = (string) content.GetValueForProperty("CertRecordOfferGuid",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordOfferGuid, global::System.Convert.ToString); @@ -127,6 +123,10 @@ internal SyncCertRecordResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordIngestionStatus = (string) content.GetValueForProperty("CertRecordIngestionStatus",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordIngestionStatus, global::System.Convert.ToString); } + if (content.Contains("CertRecordControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -148,10 +148,6 @@ internal SyncCertRecordResponse(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecord = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ICertSyncRecord) content.GetValueForProperty("CertRecord",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecord, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.CertSyncRecordTypeConverter.ConvertFrom); } - if (content.Contains("CertRecordControl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); - } if (content.Contains("CertRecordOfferGuid")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordOfferGuid = (string) content.GetValueForProperty("CertRecordOfferGuid",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordOfferGuid, global::System.Convert.ToString); @@ -164,6 +160,10 @@ internal SyncCertRecordResponse(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordIngestionStatus = (string) content.GetValueForProperty("CertRecordIngestionStatus",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordIngestionStatus, global::System.Convert.ToString); } + if (content.Contains("CertRecordControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl = (System.Collections.Generic.List) content.GetValueForProperty("CertRecordControl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ISyncCertRecordResponseInternal)this).CertRecordControl, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ControlSyncRecordTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/TriggerEvaluationResponse.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/TriggerEvaluationResponse.PowerShell.cs index ecfeeaa6403..800d4e9892f 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/TriggerEvaluationResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/TriggerEvaluationResponse.PowerShell.cs @@ -130,10 +130,6 @@ internal TriggerEvaluationResponse(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.TriggerEvaluationPropertyTypeConverter.ConvertFrom); } - if (content.Contains("QuickAssessment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment = (System.Collections.Generic.List) content.GetValueForProperty("QuickAssessment",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.QuickAssessmentTypeConverter.ConvertFrom)); - } if (content.Contains("TriggerTime")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).TriggerTime = (global::System.DateTime?) content.GetValueForProperty("TriggerTime",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).TriggerTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); @@ -146,6 +142,10 @@ internal TriggerEvaluationResponse(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).ResourceId = (System.Collections.Generic.List) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).ResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("QuickAssessment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment = (System.Collections.Generic.List) content.GetValueForProperty("QuickAssessment",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.QuickAssessmentTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -167,10 +167,6 @@ internal TriggerEvaluationResponse(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.TriggerEvaluationPropertyTypeConverter.ConvertFrom); } - if (content.Contains("QuickAssessment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment = (System.Collections.Generic.List) content.GetValueForProperty("QuickAssessment",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.QuickAssessmentTypeConverter.ConvertFrom)); - } if (content.Contains("TriggerTime")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).TriggerTime = (global::System.DateTime?) content.GetValueForProperty("TriggerTime",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).TriggerTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); @@ -183,6 +179,10 @@ internal TriggerEvaluationResponse(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).ResourceId = (System.Collections.Generic.List) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).ResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("QuickAssessment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment = (System.Collections.Generic.List) content.GetValueForProperty("QuickAssessment",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.ITriggerEvaluationResponseInternal)this).QuickAssessment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.QuickAssessmentTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } } diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResource.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResource.PowerShell.cs index 8c51d16e11a..8a5974ccaee 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResource.PowerShell.cs @@ -168,10 +168,6 @@ internal WebhookResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ContentType")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).ContentType, global::System.Convert.ToString); @@ -200,6 +196,10 @@ internal WebhookResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).SendAllEvent = (string) content.GetValueForProperty("SendAllEvent",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).SendAllEvent, global::System.Convert.ToString); } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("PayloadUrl")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).PayloadUrl = (string) content.GetValueForProperty("PayloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).PayloadUrl, global::System.Convert.ToString); @@ -281,10 +281,6 @@ internal WebhookResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ContentType")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).ContentType, global::System.Convert.ToString); @@ -313,6 +309,10 @@ internal WebhookResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).SendAllEvent = (string) content.GetValueForProperty("SendAllEvent",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).SendAllEvent, global::System.Convert.ToString); } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("PayloadUrl")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).PayloadUrl = (string) content.GetValueForProperty("PayloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourceInternal)this).PayloadUrl, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResourcePatch.PowerShell.cs b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResourcePatch.PowerShell.cs index 14e2f964a51..41745fb4b35 100644 --- a/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResourcePatch.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AppComplianceAutomation.Management/target/generated/api/Models/WebhookResourcePatch.PowerShell.cs @@ -128,10 +128,6 @@ internal WebhookResourcePatch(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.WebhookPropertiesTypeConverter.ConvertFrom); } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ContentType")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).ContentType, global::System.Convert.ToString); @@ -160,6 +156,10 @@ internal WebhookResourcePatch(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).SendAllEvent = (string) content.GetValueForProperty("SendAllEvent",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).SendAllEvent, global::System.Convert.ToString); } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("PayloadUrl")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).PayloadUrl = (string) content.GetValueForProperty("PayloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).PayloadUrl, global::System.Convert.ToString); @@ -201,10 +201,6 @@ internal WebhookResourcePatch(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.WebhookPropertiesTypeConverter.ConvertFrom); } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ContentType")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).ContentType, global::System.Convert.ToString); @@ -233,6 +229,10 @@ internal WebhookResourcePatch(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).SendAllEvent = (string) content.GetValueForProperty("SendAllEvent",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).SendAllEvent, global::System.Convert.ToString); } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("PayloadUrl")) { ((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).PayloadUrl = (string) content.GetValueForProperty("PayloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.Models.IWebhookResourcePatchInternal)this).PayloadUrl, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 899be6aeb49..8b33296a48c 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs index 0f764b377ed..2432b9a3b13 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentityV4(global::System.Collections.IDictionary content } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentityV4(global::System.Management.Automation.PSObject } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs index b5de6ed1dcb..a69cccd7ba0 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentityV4 : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentityV4() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentityV4 : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityV4Internal [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs index c44ee124c66..3656bad78db 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentityV4(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runti {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..5e0096be957 --- /dev/null +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityV4UserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityV4UserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityV4UserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityV4UserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityV4UserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityV4UserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..216c36081ae --- /dev/null +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityV4UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityV4UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityV4UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs similarity index 56% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs index 66c5ca73aab..41cdca067f4 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityV4UserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityV4UserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityV4UserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityV4UserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs index b98ff9d7075..9c153653610 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityV4UserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs similarity index 83% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs index ec85f7322b5..3800d34a940 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityV4UserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json ? new ManagedServiceIdentityV4UserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityV4UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode ToJson(Mic AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs index ebfc4ddc025..6bb6ba2b168 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs @@ -157,7 +157,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -205,7 +205,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -366,7 +366,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -414,7 +414,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.cs index e83b5f8474b..44731286626 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResource.cs @@ -47,7 +47,7 @@ public partial class OrganizationResource : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inherited)] @@ -246,7 +246,7 @@ public partial class OrganizationResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -344,8 +344,8 @@ public partial interface IOrganizationResource : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( Required = false, @@ -646,7 +646,7 @@ internal partial interface IOrganizationResourceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details of the resource. Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IMarketplaceDetails Marketplace { get; set; } /// Offer details for the marketplace that is selected by the user diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs index e30fba82842..a5ece071d28 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs @@ -117,7 +117,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -133,7 +133,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Marketplace")) { @@ -278,7 +278,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -294,7 +294,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Marketplace")) { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.cs index a47869a1fa9..222a7d8641f 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.cs @@ -36,7 +36,7 @@ public partial class OrganizationResourceUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inlined)] @@ -155,11 +155,11 @@ public partial class OrganizationResourceUpdate : public string SingleSignOnPropertySingleSignOnUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdatePropertiesInternal)Property).SingleSignOnPropertySingleSignOnUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdatePropertiesInternal)Property).SingleSignOnPropertySingleSignOnUrl = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateTags()); set => this._tag = value; } /// Email address of the user [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Inlined)] @@ -238,8 +238,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( Required = false, @@ -462,8 +462,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags Tag { get; set; } /// Email address of the user [Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Info( Required = false, @@ -539,7 +539,7 @@ internal partial interface IOrganizationResourceUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.Astro.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details of the resource. Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IMarketplaceDetails Marketplace { get; set; } /// Offer details for the marketplace that is selected by the user @@ -593,7 +593,7 @@ internal partial interface IOrganizationResourceUpdateInternal /// URL for SSO to be used by the partner to redirect the user to their system string SingleSignOnPropertySingleSignOnUrl { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags Tag { get; set; } /// Details of the user. Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserDetails User { get; set; } /// Email address of the user diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs index 4232955ee87..29d48bd2a37 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs @@ -77,7 +77,7 @@ internal OrganizationResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.Astro.Run } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ManagedServiceIdentityV4.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs similarity index 80% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs index a09bd087dd0..f751ca823fc 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models { using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial class OrganizationResourceUpdateTags { /// @@ -61,61 +61,44 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal OrganizationResourceUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +113,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal OrganizationResourceUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +130,27 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial interface IOrganizationResourceUpdateTags { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs similarity index 83% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs index 16b1c5cea0b..1df176c4af6 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class OrganizationResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return OrganizationResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +126,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IUserAssignedIdent } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs new file mode 100644 index 00000000000..d57fc9ad9df --- /dev/null +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTagsInternal + { + + /// Creates an new instance. + public OrganizationResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IOrganizationResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..2e4d826551a --- /dev/null +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; + + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.OrganizationResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs new file mode 100644 index 00000000000..779986fae7d --- /dev/null +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json ? new OrganizationResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OrganizationResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 03bd31e2141..377d5daf08e 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.cs index 51ce02e4471..b1166516b78 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Astro.Origin(Microsoft.Azure.PowerShell.Cmdlets.Astro.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.json.cs index 27890335856..122b7f2cae9 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.J return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index b7a5d554b78..34ececd5a26 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 32f95564899..d2b5ea8438b 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags ConvertFrom( } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 60% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.cs index 60e0d163245..82f07749fab 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 7e9a9cf4614..e281bf112ee 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 2fd365ef15c..ef95a886d4c 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Astro.Models using static Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonNode ToJson(Mic AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Astro.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs index d8c65ae2fcf..eebb1b8d1ca 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateExpanded.cs @@ -385,8 +385,8 @@ public partial class NewAzAstroOrganization_CreateExpanded : global::System.Mana ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateViaIdentityExpanded.cs index d39adea42d7..4ff9e99378b 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/NewAzAstroOrganization_CreateViaIdentityExpanded.cs @@ -345,8 +345,8 @@ public partial class NewAzAstroOrganization_CreateViaIdentityExpanded : global:: ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/SetAzAstroOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/SetAzAstroOrganization_UpdateExpanded.cs index 85b530b7750..e522e931c85 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/SetAzAstroOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/SetAzAstroOrganization_UpdateExpanded.cs @@ -386,8 +386,8 @@ public partial class SetAzAstroOrganization_UpdateExpanded : global::System.Mana ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs index 1bf4b522edb..3d8614ab5be 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateExpanded.cs @@ -374,8 +374,8 @@ public partial class UpdateAzAstroOrganization_UpdateExpanded : global::System.M ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -791,7 +791,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionStatus"))) { diff --git a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs index 1e0bc3f6959..772b808bc16 100644 --- a/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Astronomer.Astro.Management/target/generated/cmdlets/UpdateAzAstroOrganization_UpdateViaIdentityExpanded.cs @@ -334,8 +334,8 @@ public partial class UpdateAzAstroOrganization_UpdateViaIdentityExpanded : globa ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -771,7 +771,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Astro.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionStatus"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.PowerShell.cs index d2a3bbbfeb9..81339ea62cc 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.PowerShell.cs @@ -125,11 +125,11 @@ internal Index(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexPropertiesTypeConverter.ConvertFrom); } if (content.Contains("StorageUri")) { @@ -186,11 +186,11 @@ internal Index(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexPropertiesTypeConverter.ConvertFrom); } if (content.Contains("StorageUri")) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.cs index 377b0ebfd7e..8c3262397d5 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.cs @@ -46,13 +46,13 @@ public partial class Index : global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags _property; + private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties _property; /// /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] @@ -100,11 +100,11 @@ public partial class Index : public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags _tag; /// Asset's tags. Unlike properties, tags are fully mutable. [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexTags()); set => this._tag = value; } /// Creates an new instance. public Index() @@ -151,8 +151,8 @@ public partial interface IIndex : Update = true, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get; set; } /// /// Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development. /// @@ -232,8 +232,8 @@ public partial interface IIndex : Update = true, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get; set; } } /// Index resource Definition @@ -249,7 +249,7 @@ internal partial interface IIndexInternal /// /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get; set; } /// /// Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development. /// @@ -269,7 +269,7 @@ internal partial interface IIndexInternal /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// Asset's tags. Unlike properties, tags are fully mutable. - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.json.cs index 27e2b203589..b095f7e97ba 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.json.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Index.json.cs @@ -79,8 +79,8 @@ internal Index(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtim {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)_stage;} {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags.FromJson(__jsonTags) : _tag;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexTags.FromJson(__jsonTags) : _tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexProperties.FromJson(__jsonProperties) : _property;} {_storageUri = If( json?.PropertyT("storageUri"), out var __jsonStorageUri) ? (string)__jsonStorageUri : (string)_storageUri;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.PowerShell.cs new file mode 100644 index 00000000000..ac606a551a5 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + [System.ComponentModel.TypeConverter(typeof(IndexPropertiesTypeConverter))] + public partial class IndexProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IndexProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IndexProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IndexProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IndexProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + [System.ComponentModel.TypeConverter(typeof(IndexPropertiesTypeConverter))] + public partial interface IIndexProperties + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.TypeConverter.cs new file mode 100644 index 00000000000..665fab3adce --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.TypeConverter.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IndexPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IndexProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IndexProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IndexProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.cs new file mode 100644 index 00000000000..2d662853b89 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + public partial class IndexProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexPropertiesInternal + { + + /// Creates an new instance. + public IndexProperties() + { + + } + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + public partial interface IIndexProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + internal partial interface IIndexPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.dictionary.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.dictionary.cs new file mode 100644 index 00000000000..fc70b483a11 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + public partial class IndexProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.json.cs new file mode 100644 index 00000000000..0a2d22d147c --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexProperties.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + public partial class IndexProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json ? new IndexProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal IndexProperties(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.PowerShell.cs similarity index 83% rename from tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.PowerShell.cs index 2ee7da9f865..8bfa3e28afe 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; /// Asset's tags. Unlike properties, tags are fully mutable. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(IndexTagsTypeConverter))] + public partial class IndexTags { /// @@ -61,44 +61,44 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new IndexTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new IndexTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal IndexTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +113,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal IndexTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -149,8 +149,8 @@ public override string ToString() } } /// Asset's tags. Unlike properties, tags are fully mutable. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(IndexTagsTypeConverter))] + public partial interface IIndexTags { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.TypeConverter.cs similarity index 86% rename from tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.TypeConverter.cs index d4ce71d7f50..14c74df9c34 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class IndexTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,12 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +92,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return IndexTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +124,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models. } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return IndexTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return IndexTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.cs similarity index 77% rename from tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.cs index ef44d2baf29..e2f3ca96fce 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; /// Asset's tags. Unlike properties, tags are fully mutable. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITagsInternal + public partial class IndexTags : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public IndexTags() { } } /// Asset's tags. Unlike properties, tags are fully mutable. - public partial interface ITags : + public partial interface IIndexTags : Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray { } /// Asset's tags. Unlike properties, tags are fully mutable. - internal partial interface ITagsInternal + internal partial interface IIndexTagsInternal { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.dictionary.cs index 9ec97acec7c..8a30b12a213 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; - public partial class Tags : + public partial class IndexTags : Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IndexTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.json.cs similarity index 89% rename from tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.json.cs index a4241e68b38..82ea526c0ae 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/IndexTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; /// Asset's tags. Unlike properties, tags are fully mutable. - public partial class Tags + public partial class IndexTags { /// @@ -52,23 +52,23 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json ? new Tags(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json ? new IndexTags(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject instance to deserialize from. /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal IndexTags(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -81,13 +81,13 @@ internal Tags(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.PowerShell.cs index 0ae335042c6..d79fcb914b9 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.PowerShell.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; /// - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. /// [System.ComponentModel.TypeConverter(typeof(InnerErrorTypeConverter))] public partial class InnerError @@ -162,7 +162,7 @@ public override string ToString() return ToJsonString(); } } - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. [System.ComponentModel.TypeConverter(typeof(InnerErrorTypeConverter))] public partial interface IInnerError diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.cs index 9d1f01f3d21..ef601f2a517 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; /// - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. /// public partial class InnerError : Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IInnerError, @@ -33,7 +33,7 @@ public InnerError() } } - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. public partial interface IInnerError : Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IJsonSerializable { @@ -61,7 +61,7 @@ public partial interface IInnerError : Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IInnerError Innererror { get; set; } } - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. internal partial interface IInnerErrorInternal { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.json.cs index fe58a1128e6..a3369e5e40d 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.json.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/InnerError.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; /// - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. + /// An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. /// public partial class InnerError { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.PowerShell.cs index e335f5ec182..24a0d15988d 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.PowerShell.cs @@ -125,11 +125,11 @@ internal Prompt(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptPropertiesTypeConverter.ConvertFrom); } if (content.Contains("DataUri")) { @@ -190,11 +190,11 @@ internal Prompt(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptPropertiesTypeConverter.ConvertFrom); } if (content.Contains("DataUri")) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.cs index dac954a5456..28624d7205e 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.cs @@ -55,13 +55,13 @@ public partial class Prompt : global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags _property; + private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties _property; /// /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] @@ -100,11 +100,11 @@ public partial class Prompt : public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags _tag; /// Asset's tags. Unlike properties, tags are fully mutable. [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptTags()); set => this._tag = value; } /// Backing field for property. private string _templatePath; @@ -171,8 +171,8 @@ public partial interface IPrompt : Update = true, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get; set; } /// /// Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development. /// @@ -239,8 +239,8 @@ public partial interface IPrompt : Update = true, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get; set; } /// Relative path of the prompt data file at the dataUri location [Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Info( Required = true, @@ -271,7 +271,7 @@ internal partial interface IPromptInternal /// /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get; set; } /// /// Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development. /// @@ -287,7 +287,7 @@ internal partial interface IPromptInternal /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// Asset's tags. Unlike properties, tags are fully mutable. - Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get; set; } /// Relative path of the prompt data file at the dataUri location string TemplatePath { get; set; } diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.json.cs index f2413950421..f45ff8e4a4e 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.json.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/Prompt.json.cs @@ -79,8 +79,8 @@ internal Prompt(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runti {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} {_stage = If( json?.PropertyT("stage"), out var __jsonStage) ? (string)__jsonStage : (string)_stage;} {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags.FromJson(__jsonTags) : _tag;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.Tags.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptTags.FromJson(__jsonTags) : _tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptProperties.FromJson(__jsonProperties) : _property;} {_dataUri = If( json?.PropertyT("dataUri"), out var __jsonDataUri) ? (string)__jsonDataUri : (string)_dataUri;} {_templatePath = If( json?.PropertyT("templatePath"), out var __jsonTemplatePath) ? (string)__jsonTemplatePath : (string)_templatePath;} AfterFromJson(json); diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.PowerShell.cs new file mode 100644 index 00000000000..8aa063df2a3 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + [System.ComponentModel.TypeConverter(typeof(PromptPropertiesTypeConverter))] + public partial class PromptProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PromptProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PromptProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PromptProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PromptProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + [System.ComponentModel.TypeConverter(typeof(PromptPropertiesTypeConverter))] + public partial interface IPromptProperties + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.TypeConverter.cs new file mode 100644 index 00000000000..8b7a80843b9 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.TypeConverter.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PromptPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PromptProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PromptProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PromptProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.cs new file mode 100644 index 00000000000..e15c1b20bbe --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + public partial class PromptProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptPropertiesInternal + { + + /// Creates an new instance. + public PromptProperties() + { + + } + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + public partial interface IPromptProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + + } + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + internal partial interface IPromptPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.dictionary.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.dictionary.cs new file mode 100644 index 00000000000..258088156cb --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + public partial class PromptProperties : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.json.cs new file mode 100644 index 00000000000..e7a670faf49 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptProperties.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// + /// Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// + public partial class PromptProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json ? new PromptProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PromptProperties(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.PowerShell.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.PowerShell.cs new file mode 100644 index 00000000000..38241ee4b1e --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// Asset's tags. Unlike properties, tags are fully mutable. + [System.ComponentModel.TypeConverter(typeof(PromptTagsTypeConverter))] + public partial class PromptTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PromptTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PromptTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PromptTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PromptTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Asset's tags. Unlike properties, tags are fully mutable. + [System.ComponentModel.TypeConverter(typeof(PromptTagsTypeConverter))] + public partial interface IPromptTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.TypeConverter.cs new file mode 100644 index 00000000000..61d3c4b4c0d --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.TypeConverter.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PromptTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PromptTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PromptTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PromptTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.cs new file mode 100644 index 00000000000..fdb98f891a4 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// Asset's tags. Unlike properties, tags are fully mutable. + public partial class PromptTags : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTagsInternal + { + + /// Creates an new instance. + public PromptTags() + { + + } + } + /// Asset's tags. Unlike properties, tags are fully mutable. + public partial interface IPromptTags : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + + } + /// Asset's tags. Unlike properties, tags are fully mutable. + internal partial interface IPromptTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.dictionary.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.dictionary.cs new file mode 100644 index 00000000000..896f2538c34 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + public partial class PromptTags : + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.PromptTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.json.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.json.cs new file mode 100644 index 00000000000..1309f7f9f14 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/api/Models/PromptTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Extensions; + + /// Asset's tags. Unlike properties, tags are fully mutable. + public partial class PromptTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json ? new PromptTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal PromptTags(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateExpanded.cs index ea766a4be9e..3763a18f181 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateExpanded.cs @@ -152,8 +152,8 @@ public partial class NewAzMlWorkspaceIndex_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -239,8 +239,8 @@ public partial class NewAzMlWorkspaceIndex_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _version; diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityExpanded.cs index a8149d363fe..f256f7fd255 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityExpanded.cs @@ -146,8 +146,8 @@ public partial class NewAzMlWorkspaceIndex_CreateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class NewAzMlWorkspaceIndex_CreateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _workspaceName; diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded.cs index ef18da4f123..87a7de8c6f4 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded.cs @@ -146,8 +146,8 @@ public partial class NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded : glob ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class NewAzMlWorkspaceIndex_CreateViaIdentityIndexExpanded : glob ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _version; diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateExpanded.cs index 6005027fcd0..ba3297fd510 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateExpanded.cs @@ -165,8 +165,8 @@ public partial class NewAzMlWorkspacePrompt_CreateExpanded : global::System.Mana ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -239,8 +239,8 @@ public partial class NewAzMlWorkspacePrompt_CreateExpanded : global::System.Mana ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Relative path of the prompt data file at the dataUri location")] diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityExpanded.cs index c890495b2b0..92ffbd96dfe 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityExpanded.cs @@ -159,8 +159,8 @@ public partial class NewAzMlWorkspacePrompt_CreateViaIdentityExpanded : global:: ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class NewAzMlWorkspacePrompt_CreateViaIdentityExpanded : global:: ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Relative path of the prompt data file at the dataUri location")] diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded.cs index 1863a85749b..7344d3fcfb5 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded.cs @@ -159,8 +159,8 @@ public partial class NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded : gl ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class NewAzMlWorkspacePrompt_CreateViaIdentityPromptExpanded : gl ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Relative path of the prompt data file at the dataUri location")] diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspaceIndex_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspaceIndex_UpdateExpanded.cs index 13cceb95120..109b84c596a 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspaceIndex_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspaceIndex_UpdateExpanded.cs @@ -153,8 +153,8 @@ public partial class SetAzMlWorkspaceIndex_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -240,8 +240,8 @@ public partial class SetAzMlWorkspaceIndex_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _version; diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspacePrompt_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspacePrompt_UpdateExpanded.cs index 900b166a814..b578d5908bf 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspacePrompt_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/SetAzMlWorkspacePrompt_UpdateExpanded.cs @@ -166,8 +166,8 @@ public partial class SetAzMlWorkspacePrompt_UpdateExpanded : global::System.Mana ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -240,8 +240,8 @@ public partial class SetAzMlWorkspacePrompt_UpdateExpanded : global::System.Mana ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Relative path of the prompt data file at the dataUri location")] diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateExpanded.cs index c0c4c3e3674..280bed023c3 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateExpanded.cs @@ -152,8 +152,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -239,8 +239,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _version; @@ -537,11 +537,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded.cs index 6937bdc93d4..de68e3748b7 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded.cs @@ -146,8 +146,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _workspaceName; @@ -535,11 +535,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded.cs index b1514978c27..b425517cde3 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded.cs @@ -146,8 +146,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded : g ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class UpdateAzMlWorkspaceIndex_UpdateViaIdentityIndexExpanded : g ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Backing field for property. private string _version; @@ -546,11 +546,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IIndexProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateExpanded.cs index bc04d133c96..cf52e6dede2 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateExpanded.cs @@ -165,8 +165,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateExpanded : global::System.M ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -239,8 +239,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateExpanded : global::System.M ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of the prompt data file at the dataUri location")] @@ -548,11 +548,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded.cs index f003a24e0a7..6bca38162ab 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded.cs @@ -159,8 +159,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded : globa ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateViaIdentityExpanded : globa ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of the prompt data file at the dataUri location")] @@ -546,11 +546,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded.cs b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded.cs index 15ff17514fc..c01666c02bb 100644 --- a/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureAI.Assets/target/generated/cmdlets/UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded.cs @@ -159,8 +159,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded : ReadOnly = false, Description = @"Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties Property { get => _body.Property ?? null /* object */; set => _body.Property = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -233,8 +233,8 @@ public partial class UpdateAzMlWorkspacePrompt_UpdateViaIdentityPromptExpanded : ReadOnly = false, Description = @"Asset's tags. Unlike properties, tags are fully mutable.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Relative path of the prompt data file at the dataUri location [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Relative path of the prompt data file at the dataUri location")] @@ -557,11 +557,11 @@ private void Update_body() } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Property"))) { - this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.ITags)(this.MyInvocation?.BoundParameters["Property"]); + this.Property = (Microsoft.Azure.PowerShell.Cmdlets.MachineLearningServices.Models.IPromptProperties)(this.MyInvocation?.BoundParameters["Property"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataUri"))) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/BaseVirtualMachineProfile.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/BaseVirtualMachineProfile.PowerShell.cs index 2485f243d50..46ab0673960 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/BaseVirtualMachineProfile.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/BaseVirtualMachineProfile.PowerShell.cs @@ -146,10 +146,6 @@ internal BaseVirtualMachineProfile(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).DiagnosticProfileBootDiagnostic = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBootDiagnostics) content.GetValueForProperty("DiagnosticProfileBootDiagnostic",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).DiagnosticProfileBootDiagnostic, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.BootDiagnosticsTypeConverter.ConvertFrom); } - if (content.Contains("ExtensionProfileExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension = (System.Collections.Generic.List) content.GetValueForProperty("ExtensionProfileExtension",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionTypeConverter.ConvertFrom)); - } if (content.Contains("ApplicationProfileGalleryApplication")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ApplicationProfileGalleryApplication = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationProfileGalleryApplication",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ApplicationProfileGalleryApplication, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VMGalleryApplicationTypeConverter.ConvertFrom)); @@ -190,6 +186,10 @@ internal BaseVirtualMachineProfile(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ProxyAgentSettingMode = (string) content.GetValueForProperty("ProxyAgentSettingMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ProxyAgentSettingMode, global::System.Convert.ToString); } + if (content.Contains("ExtensionProfileExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension = (System.Collections.Generic.List) content.GetValueForProperty("ExtensionProfileExtension",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionTypeConverter.ConvertFrom)); + } if (content.Contains("ExtensionProfileExtensionsTimeBudget")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtensionsTimeBudget = (string) content.GetValueForProperty("ExtensionProfileExtensionsTimeBudget",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtensionsTimeBudget, global::System.Convert.ToString); @@ -367,10 +367,6 @@ internal BaseVirtualMachineProfile(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).DiagnosticProfileBootDiagnostic = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBootDiagnostics) content.GetValueForProperty("DiagnosticProfileBootDiagnostic",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).DiagnosticProfileBootDiagnostic, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.BootDiagnosticsTypeConverter.ConvertFrom); } - if (content.Contains("ExtensionProfileExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension = (System.Collections.Generic.List) content.GetValueForProperty("ExtensionProfileExtension",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionTypeConverter.ConvertFrom)); - } if (content.Contains("ApplicationProfileGalleryApplication")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ApplicationProfileGalleryApplication = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationProfileGalleryApplication",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ApplicationProfileGalleryApplication, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VMGalleryApplicationTypeConverter.ConvertFrom)); @@ -411,6 +407,10 @@ internal BaseVirtualMachineProfile(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ProxyAgentSettingMode = (string) content.GetValueForProperty("ProxyAgentSettingMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ProxyAgentSettingMode, global::System.Convert.ToString); } + if (content.Contains("ExtensionProfileExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension = (System.Collections.Generic.List) content.GetValueForProperty("ExtensionProfileExtension",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionTypeConverter.ConvertFrom)); + } if (content.Contains("ExtensionProfileExtensionsTimeBudget")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtensionsTimeBudget = (string) content.GetValueForProperty("ExtensionProfileExtensionsTimeBudget",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IBaseVirtualMachineProfileInternal)this).ExtensionProfileExtensionsTimeBudget, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 2c76351893d..eac6b4d19e8 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.PowerShell.cs index 79645757b59..f5f1252e76f 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.PowerShell.cs @@ -158,7 +158,7 @@ internal Fleet(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -222,7 +222,7 @@ internal Fleet(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { @@ -375,7 +375,7 @@ internal Fleet(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -439,7 +439,7 @@ internal Fleet(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.cs index cc7261719bc..b518c159b10 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Fleet.cs @@ -88,7 +88,7 @@ public partial class Fleet : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inherited)] @@ -298,7 +298,7 @@ public partial class Fleet : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// Specifies the time at which the Compute Fleet is created. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -487,8 +487,8 @@ VMs in the same fault domain share a common power source and network switch. Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// A user defined name of the 3rd Party Artifact that is being procured. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -798,7 +798,7 @@ internal partial interface IFleetInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Details of the resource plan. Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IPlan Plan { get; set; } /// A user defined name of the 3rd Party Artifact that is being procured. diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.PowerShell.cs index 9f94b52539a..20feb54eb44 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.PowerShell.cs @@ -114,7 +114,7 @@ internal FleetUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ComputeProfile")) { @@ -134,7 +134,7 @@ internal FleetUpdate(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { @@ -275,7 +275,7 @@ internal FleetUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ComputeProfile")) { @@ -295,7 +295,7 @@ internal FleetUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PlanName")) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.cs index b2c39595ef9..89afb666562 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.cs @@ -64,7 +64,7 @@ public partial class FleetUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for AdditionalLocationsProfile Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IAdditionalLocationsProfile Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateInternal.AdditionalLocationsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetPropertiesInternal)Property).AdditionalLocationsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetPropertiesInternal)Property).AdditionalLocationsProfile = value ?? null /* model class */; } @@ -195,11 +195,11 @@ public partial class FleetUpdate : public int? SpotPriorityProfileMinCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetPropertiesInternal)Property).SpotPriorityProfileMinCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetPropertiesInternal)Property).SpotPriorityProfileMinCapacity = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetUpdateTags()); set => this._tag = value; } /// Specifies the time at which the Compute Fleet is created. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -336,8 +336,8 @@ VMs in the same fault domain share a common power source and network switch. Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// A user defined name of the 3rd Party Artifact that is being procured. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -540,8 +540,8 @@ VMs in the same fault domain share a common power source and network switch. Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags Tag { get; set; } /// Specifies the time at which the Compute Fleet is created. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -639,7 +639,7 @@ internal partial interface IFleetUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Updatable resource plan Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IResourcePlanUpdate Plan { get; set; } /// A user defined name of the 3rd Party Artifact that is being procured. @@ -704,7 +704,7 @@ internal partial interface IFleetUpdateInternal /// int? SpotPriorityProfileMinCapacity { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags Tag { get; set; } /// Specifies the time at which the Compute Fleet is created. global::System.DateTime? TimeCreated { get; set; } /// Specifies the ID which uniquely identifies a Compute Fleet. diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.json.cs index 8a0e24ff71a..df42fecc768 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdate.json.cs @@ -66,7 +66,7 @@ internal FleetUpdate(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Jso {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdate.FromJson(__jsonIdentity) : _identity;} {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ResourcePlanUpdate.FromJson(__jsonPlan) : _plan;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.PowerShell.cs index 9dceaabfa9a..f7aa4d7d898 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(FleetUpdateTagsTypeConverter))] + public partial class FleetUpdateTags { /// @@ -61,44 +61,37 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new FleetUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new FleetUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal FleetUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +106,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal FleetUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -131,6 +124,13 @@ internal Tags(global::System.Management.Automation.PSObject content) AfterDeserializePSObject(content); } + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. @@ -149,8 +149,8 @@ public override string ToString() } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(FleetUpdateTagsTypeConverter))] + public partial interface IFleetUpdateTags { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.TypeConverter.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.TypeConverter.cs index d09fb3f3bcc..fa8a8b7a359 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class SettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class FleetUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class SettingsTypeConverter : global::System.Management.Automatio public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Settings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return FleetUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings C } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Settings.DeserializeFromPSObject(sourceValue); + return FleetUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Settings.DeserializeFromDictionary(sourceValue); + return FleetUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.cs similarity index 73% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.cs index 2b1cb429535..2f6374edae1 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITagsInternal + public partial class FleetUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public FleetUpdateTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface IFleetUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface IFleetUpdateTagsInternal { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.dictionary.cs index 940de0b0781..f964b289562 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; - public partial class Tags : + public partial class FleetUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.FleetUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.json.cs index 73f7dfd895d..c339a6921ae 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/FleetUpdateTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class FleetUpdateTags { /// @@ -52,21 +52,11 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags. - /// - /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal FleetUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -79,13 +69,25 @@ internal Tags(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonO } /// - /// Serializes this instance of into a . + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IFleetUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new FleetUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index 2999e8f918f..b2c33c769bd 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 660b393a2e1..5865d0f44a0 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index 5fc6af92832..319f40613c6 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet. {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs index e6b4b8bc27b..6858b38fbe1 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs @@ -113,7 +113,7 @@ internal ManagedServiceIdentityUpdate(global::System.Collections.IDictionary con } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -138,7 +138,7 @@ internal ManagedServiceIdentityUpdate(global::System.Management.Automation.PSObj } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs index 348af52ec27..51c93ea3660 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs @@ -19,11 +19,11 @@ public partial class ManagedServiceIdentityUpdate : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentityUpdate() @@ -56,8 +56,8 @@ public partial interface IManagedServiceIdentityUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get; set; } } /// The template for adding optional properties. @@ -68,7 +68,7 @@ internal partial interface IManagedServiceIdentityUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs index 22b4df69b36..698558f4f45 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs @@ -76,7 +76,7 @@ internal ManagedServiceIdentityUpdate(Microsoft.Azure.PowerShell.Cmdlets.Compute return; } {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..8caf493d8fd --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUpdateUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUpdateUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUpdateUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUpdateUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUpdateUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..60aa7e06fee --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs new file mode 100644 index 00000000000..caf3bcce1a7 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// The identities assigned to this resource by the user. + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentitiesInternal + { + + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUpdateUserAssignedIdentities() + { + + } + } + /// The identities assigned to this resource by the user. + public partial interface IManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + + } + /// The identities assigned to this resource by the user. + internal partial interface IManagedServiceIdentityUpdateUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs new file mode 100644 index 00000000000..0189579a30e --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUpdateUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs new file mode 100644 index 00000000000..43545400261 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// The identities assigned to this resource by the user. + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUpdateUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUpdateUserAssignedIdentities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUpdateUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..b3dd53c48e1 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..2d4242aa67b --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 74c5130b8b7..c0194ddbfda 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index decab6fda8a..58029938684 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index a63db32cf9f..8253be90566 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJ AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 0645c14416e..2645524c388 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.cs index aceb469de57..95a03b13222 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.json.cs index 6bb07972791..3117c408916 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 81% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.PowerShell.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index d290cfec185..52c9e4518e4 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models { using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; - /// Json formatted public settings for the extension. - [System.ComponentModel.TypeConverter(typeof(SettingsTypeConverter))] - public partial class Settings + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Settings partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Settings(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Settings(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Settings(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Settings(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Settings(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Settings(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } - /// Json formatted public settings for the extension. - [System.ComponentModel.TypeConverter(typeof(SettingsTypeConverter))] - public partial interface ISettings + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 5b22d70249c..cb0ea58ab9b 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Conve } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 00000000000..bd5af787dd9 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 00000000000..06f40b87466 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.json.cs new file mode 100644 index 00000000000..f407ab8c036 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSet.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSet.PowerShell.cs index d2ca29e450c..166cd7e15fb 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSet.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSet.PowerShell.cs @@ -140,10 +140,6 @@ internal VirtualMachineScaleSet(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).OperationStatus = (string) content.GetValueForProperty("OperationStatus",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).OperationStatus, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ApiErrorBaseTypeConverter.ConvertFrom)); - } if (content.Contains("Innererror")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.InnerErrorTypeConverter.ConvertFrom); @@ -160,6 +156,10 @@ internal VirtualMachineScaleSet(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ApiErrorBaseTypeConverter.ConvertFrom)); + } if (content.Contains("InnererrorErrorDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).InnererrorErrorDetail = (string) content.GetValueForProperty("InnererrorErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).InnererrorErrorDetail, global::System.Convert.ToString); @@ -201,10 +201,6 @@ internal VirtualMachineScaleSet(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).OperationStatus = (string) content.GetValueForProperty("OperationStatus",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).OperationStatus, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ApiErrorBaseTypeConverter.ConvertFrom)); - } if (content.Contains("Innererror")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.InnerErrorTypeConverter.ConvertFrom); @@ -221,6 +217,10 @@ internal VirtualMachineScaleSet(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ApiErrorBaseTypeConverter.ConvertFrom)); + } if (content.Contains("InnererrorErrorDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).InnererrorErrorDetail = (string) content.GetValueForProperty("InnererrorErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetInternal)this).InnererrorErrorDetail, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.PowerShell.cs index aab48c67a87..2ce61b2082b 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.PowerShell.cs @@ -140,10 +140,6 @@ internal VirtualMachineScaleSetExtension(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); - } if (content.Contains("ProtectedSettingsFromKeyVault")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSettingsFromKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IKeyVaultSecretReference) content.GetValueForProperty("ProtectedSettingsFromKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSettingsFromKeyVault, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.KeyVaultSecretReferenceTypeConverter.ConvertFrom); @@ -172,9 +168,13 @@ internal VirtualMachineScaleSetExtension(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).EnableAutomaticUpgrade = (bool?) content.GetValueForProperty("EnableAutomaticUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).EnableAutomaticUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter.ConvertFrom); + } if (content.Contains("ProtectedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { @@ -233,10 +233,6 @@ internal VirtualMachineScaleSetExtension(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); - } if (content.Contains("ProtectedSettingsFromKeyVault")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSettingsFromKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IKeyVaultSecretReference) content.GetValueForProperty("ProtectedSettingsFromKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSettingsFromKeyVault, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.KeyVaultSecretReferenceTypeConverter.ConvertFrom); @@ -265,9 +261,13 @@ internal VirtualMachineScaleSetExtension(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).EnableAutomaticUpgrade = (bool?) content.GetValueForProperty("EnableAutomaticUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).EnableAutomaticUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter.ConvertFrom); + } if (content.Contains("ProtectedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.cs index 97a899a098d..e122d2de55b 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.cs @@ -82,7 +82,7 @@ public partial class VirtualMachineScaleSetExtension : /// protectedSettingsFromKeyVault or no protected settings at all. /// [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).ProtectedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).ProtectedSetting = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).ProtectedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).ProtectedSetting = value ?? null /* model class */; } /// The URL referencing a secret in a Key Vault. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -105,7 +105,7 @@ public partial class VirtualMachineScaleSetExtension : /// Json formatted public settings for the extension. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).Setting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).Setting = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).Setting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)Property).Setting = value ?? null /* model class */; } /// Resource Id [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -235,8 +235,8 @@ public partial interface IVirtualMachineScaleSetExtension : Description = @"The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", SerializedName = @"protectedSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get; set; } /// The URL referencing a secret in a Key Vault. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -294,8 +294,8 @@ public partial interface IVirtualMachineScaleSetExtension : Update = true, Description = @"Json formatted public settings for the extension.", SerializedName = @"settings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get; set; } /// Resource Id [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -381,7 +381,7 @@ internal partial interface IVirtualMachineScaleSetExtensionInternal /// The extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get; set; } /// The URL referencing a secret in a Key Vault. string ProtectedSettingFromKeyVaultSecretUrl { get; set; } /// The relative URL of the Key Vault containing the secret. @@ -401,7 +401,7 @@ internal partial interface IVirtualMachineScaleSetExtensionInternal /// The name of the extension handler publisher. string Publisher { get; set; } /// Json formatted public settings for the extension. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get; set; } /// Resource Id string SourceVaultId { get; set; } /// diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.PowerShell.cs index cbee3583c7c..3f5cb1923bf 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.PowerShell.cs @@ -159,11 +159,11 @@ internal VirtualMachineScaleSetExtensionProperties(global::System.Collections.ID } if (content.Contains("Setting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProtectedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { @@ -236,11 +236,11 @@ internal VirtualMachineScaleSetExtensionProperties(global::System.Management.Aut } if (content.Contains("Setting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProtectedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) content.GetValueForProperty("ProtectedSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal)this).ProtectedSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.cs index f5e2f5d0794..c77af9ad24a 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.cs @@ -53,14 +53,14 @@ public partial class VirtualMachineScaleSetExtensionProperties : string Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings _protectedSetting; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings _protectedSetting; /// /// The extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get => (this._protectedSetting = this._protectedSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings()); set => this._protectedSetting = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get => (this._protectedSetting = this._protectedSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettings()); set => this._protectedSetting = value; } /// The URL referencing a secret in a Key Vault. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -101,11 +101,11 @@ public partial class VirtualMachineScaleSetExtensionProperties : public string Publisher { get => this._publisher; set => this._publisher = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings _setting; + private Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings _setting; /// Json formatted public settings for the extension. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings()); set => this._setting = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettings()); set => this._setting = value; } /// Resource Id [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Origin(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.PropertyOrigin.Inlined)] @@ -210,8 +210,8 @@ public partial interface IVirtualMachineScaleSetExtensionProperties : Description = @"The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", SerializedName = @"protectedSettings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get; set; } /// The URL referencing a secret in a Key Vault. [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -269,8 +269,8 @@ public partial interface IVirtualMachineScaleSetExtensionProperties : Update = true, Description = @"Json formatted public settings for the extension.", SerializedName = @"settings", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings) })] - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get; set; } /// Resource Id [Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info( Required = false, @@ -348,7 +348,7 @@ internal partial interface IVirtualMachineScaleSetExtensionPropertiesInternal /// The extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings ProtectedSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ProtectedSetting { get; set; } /// The URL referencing a secret in a Key Vault. string ProtectedSettingFromKeyVaultSecretUrl { get; set; } /// The relative URL of the Key Vault containing the secret. @@ -368,7 +368,7 @@ internal partial interface IVirtualMachineScaleSetExtensionPropertiesInternal /// The name of the extension handler publisher. string Publisher { get; set; } /// Json formatted public settings for the extension. - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings Setting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings Setting { get; set; } /// Resource Id string SourceVaultId { get; set; } /// diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.json.cs index 52454958e94..c7da0c57859 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.json.cs @@ -133,7 +133,7 @@ internal VirtualMachineScaleSetExtensionProperties(Microsoft.Azure.PowerShell.Cm {_typeHandlerVersion = If( json?.PropertyT("typeHandlerVersion"), out var __jsonTypeHandlerVersion) ? (string)__jsonTypeHandlerVersion : (string)_typeHandlerVersion;} {_autoUpgradeMinorVersion = If( json?.PropertyT("autoUpgradeMinorVersion"), out var __jsonAutoUpgradeMinorVersion) ? (bool?)__jsonAutoUpgradeMinorVersion : _autoUpgradeMinorVersion;} {_enableAutomaticUpgrade = If( json?.PropertyT("enableAutomaticUpgrade"), out var __jsonEnableAutomaticUpgrade) ? (bool?)__jsonEnableAutomaticUpgrade : _enableAutomaticUpgrade;} - {_setting = If( json?.PropertyT("settings"), out var __jsonSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings.FromJson(__jsonSettings) : _setting;} + {_setting = If( json?.PropertyT("settings"), out var __jsonSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettings.FromJson(__jsonSettings) : _setting;} {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} {_provisionAfterExtension = If( json?.PropertyT("provisionAfterExtensions"), out var __jsonProvisionAfterExtensions) ? If( __jsonProvisionAfterExtensions as Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> 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;} {_suppressFailure = If( json?.PropertyT("suppressFailures"), out var __jsonSuppressFailures) ? (bool?)__jsonSuppressFailures : _suppressFailure;} diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.PowerShell.cs new file mode 100644 index 00000000000..8293631bc3f --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [System.ComponentModel.TypeConverter(typeof(VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter))] + public partial class VirtualMachineScaleSetExtensionPropertiesProtectedSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachineScaleSetExtensionPropertiesProtectedSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachineScaleSetExtensionPropertiesProtectedSettings(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualMachineScaleSetExtensionPropertiesProtectedSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachineScaleSetExtensionPropertiesProtectedSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter))] + public partial interface IVirtualMachineScaleSetExtensionPropertiesProtectedSettings + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.TypeConverter.cs new file mode 100644 index 00000000000..ae886154952 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualMachineScaleSetExtensionPropertiesProtectedSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no + /// suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualMachineScaleSetExtensionPropertiesProtectedSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualMachineScaleSetExtensionPropertiesProtectedSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualMachineScaleSetExtensionPropertiesProtectedSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.cs new file mode 100644 index 00000000000..f664dd9119a --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + public partial class VirtualMachineScaleSetExtensionPropertiesProtectedSettings : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettingsInternal + { + + /// + /// Creates an new instance. + /// + public VirtualMachineScaleSetExtensionPropertiesProtectedSettings() + { + + } + } + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + public partial interface IVirtualMachineScaleSetExtensionPropertiesProtectedSettings : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + + } + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + internal partial interface IVirtualMachineScaleSetExtensionPropertiesProtectedSettingsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.dictionary.cs new file mode 100644 index 00000000000..60c1168ffbd --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + public partial class VirtualMachineScaleSetExtensionPropertiesProtectedSettings : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesProtectedSettings source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.json.cs new file mode 100644 index 00000000000..d9490e76642 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesProtectedSettings.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; + + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + public partial class VirtualMachineScaleSetExtensionPropertiesProtectedSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesProtectedSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new VirtualMachineScaleSetExtensionPropertiesProtectedSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. + /// + internal VirtualMachineScaleSetExtensionPropertiesProtectedSettings(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.PowerShell.cs new file mode 100644 index 00000000000..f41c9b9e210 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// Json formatted public settings for the extension. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter))] + public partial class VirtualMachineScaleSetExtensionPropertiesSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachineScaleSetExtensionPropertiesSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachineScaleSetExtensionPropertiesSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualMachineScaleSetExtensionPropertiesSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachineScaleSetExtensionPropertiesSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Json formatted public settings for the extension. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter))] + public partial interface IVirtualMachineScaleSetExtensionPropertiesSettings + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.TypeConverter.cs new file mode 100644 index 00000000000..8a0b8bddd84 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualMachineScaleSetExtensionPropertiesSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualMachineScaleSetExtensionPropertiesSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualMachineScaleSetExtensionPropertiesSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualMachineScaleSetExtensionPropertiesSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.cs similarity index 62% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.cs index 4c62c2870be..37859ccdf50 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// Json formatted public settings for the extension. - public partial class Settings : - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings, - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettingsInternal + public partial class VirtualMachineScaleSetExtensionPropertiesSettings : + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings, + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettingsInternal { - /// Creates an new instance. - public Settings() + /// + /// Creates an new instance. + /// + public VirtualMachineScaleSetExtensionPropertiesSettings() { } } /// Json formatted public settings for the extension. - public partial interface ISettings : + public partial interface IVirtualMachineScaleSetExtensionPropertiesSettings : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { } /// Json formatted public settings for the extension. - internal partial interface ISettingsInternal + internal partial interface IVirtualMachineScaleSetExtensionPropertiesSettingsInternal { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.dictionary.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.dictionary.cs similarity index 94% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.dictionary.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.dictionary.cs index 4f834ae24d4..16722a86d50 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; - public partial class Settings : + public partial class VirtualMachineScaleSetExtensionPropertiesSettings : Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetExtensionPropertiesSettings source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.json.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.json.cs similarity index 83% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.json.cs rename to tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.json.cs index 4c5c976ace6..10ad17cb9c2 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/Settings.json.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionPropertiesSettings.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models using static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Extensions; /// Json formatted public settings for the extension. - public partial class Settings + public partial class VirtualMachineScaleSetExtensionPropertiesSettings { /// @@ -52,42 +52,27 @@ public partial class Settings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetExtensionPropertiesSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new Settings(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json ? new VirtualMachineScaleSetExtensionPropertiesSettings(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Settings(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode serializationMode) { @@ -103,5 +88,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJ AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject instance to deserialize from. + /// + internal VirtualMachineScaleSetExtensionPropertiesSettings(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfiguration.PowerShell.cs index 198d234efa3..7ac49ddfdb6 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfiguration.PowerShell.cs @@ -185,10 +185,6 @@ internal VirtualMachineScaleSetIPConfiguration(global::System.Collections.IDicti { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressConfigurationName = (string) content.GetValueForProperty("PublicIPAddressConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressConfigurationName, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -201,6 +197,10 @@ internal VirtualMachineScaleSetIPConfiguration(global::System.Collections.IDicti { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); @@ -302,10 +302,6 @@ internal VirtualMachineScaleSetIPConfiguration(global::System.Management.Automat { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressConfigurationName = (string) content.GetValueForProperty("PublicIPAddressConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressConfigurationName, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -318,6 +314,10 @@ internal VirtualMachineScaleSetIPConfiguration(global::System.Management.Automat { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfigurationProperties.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfigurationProperties.PowerShell.cs index a0e106b91c4..2e5faef124f 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfigurationProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetIPConfigurationProperties.PowerShell.cs @@ -180,10 +180,6 @@ internal VirtualMachineScaleSetIPConfigurationProperties(global::System.Collecti { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressConfigurationName = (string) content.GetValueForProperty("PublicIPAddressConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressConfigurationName, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -196,6 +192,10 @@ internal VirtualMachineScaleSetIPConfigurationProperties(global::System.Collecti { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); @@ -289,10 +289,6 @@ internal VirtualMachineScaleSetIPConfigurationProperties(global::System.Manageme { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressConfigurationName = (string) content.GetValueForProperty("PublicIPAddressConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressConfigurationName, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -305,6 +301,10 @@ internal VirtualMachineScaleSetIPConfigurationProperties(global::System.Manageme { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetIPConfigurationPropertiesInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetNetworkConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetNetworkConfiguration.PowerShell.cs index 32ec539e980..d6ab02802ce 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetNetworkConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetNetworkConfiguration.PowerShell.cs @@ -137,10 +137,6 @@ internal VirtualMachineScaleSetNetworkConfiguration(global::System.Collections.I { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).Name, global::System.Convert.ToString); } - if (content.Contains("IPConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPConfigurationTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkSecurityGroup")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).NetworkSecurityGroup = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISubResource) content.GetValueForProperty("NetworkSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).NetworkSecurityGroup, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SubResourceTypeConverter.ConvertFrom); @@ -165,6 +161,10 @@ internal VirtualMachineScaleSetNetworkConfiguration(global::System.Collections.I { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableFpga = (bool?) content.GetValueForProperty("EnableFpga",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableFpga, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } + if (content.Contains("IPConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPConfigurationTypeConverter.ConvertFrom)); + } if (content.Contains("EnableIPForwarding")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableIPForwarding = (bool?) content.GetValueForProperty("EnableIPForwarding",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableIPForwarding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); @@ -214,10 +214,6 @@ internal VirtualMachineScaleSetNetworkConfiguration(global::System.Management.Au { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).Name, global::System.Convert.ToString); } - if (content.Contains("IPConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPConfigurationTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkSecurityGroup")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).NetworkSecurityGroup = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISubResource) content.GetValueForProperty("NetworkSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).NetworkSecurityGroup, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SubResourceTypeConverter.ConvertFrom); @@ -242,6 +238,10 @@ internal VirtualMachineScaleSetNetworkConfiguration(global::System.Management.Au { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableFpga = (bool?) content.GetValueForProperty("EnableFpga",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableFpga, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } + if (content.Contains("IPConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPConfigurationTypeConverter.ConvertFrom)); + } if (content.Contains("EnableIPForwarding")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableIPForwarding = (bool?) content.GetValueForProperty("EnableIPForwarding",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetNetworkConfigurationInternal)this).EnableIPForwarding, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.PowerShell.cs index 121e60fd903..ff5fb671508 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.PowerShell.cs @@ -188,10 +188,6 @@ internal VirtualMachineScaleSetOSProfile(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowConfigurationEnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("WindowConfigurationEnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowConfigurationEnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("WinRmListener")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); - } if (content.Contains("LinuxConfigurationSsh")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationSsh = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISshConfiguration) content.GetValueForProperty("LinuxConfigurationSsh",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationSsh, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshConfigurationTypeConverter.ConvertFrom); @@ -212,10 +208,6 @@ internal VirtualMachineScaleSetOSProfile(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationEnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("LinuxConfigurationEnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationEnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshPublicKeyTypeConverter.ConvertFrom)); - } if (content.Contains("WindowsConfigurationPatchSettingsAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("WindowsConfigurationPatchSettingsAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WindowsVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); @@ -232,6 +224,14 @@ internal VirtualMachineScaleSetOSProfile(global::System.Collections.IDictionary { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAssessmentMode = (string) content.GetValueForProperty("WindowsConfigurationPatchSettingsAssessmentMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAssessmentMode, global::System.Convert.ToString); } + if (content.Contains("WinRmListener")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } if (content.Contains("LinuxConfigurationPatchSettingsAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationPatchSettingsAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ILinuxVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("LinuxConfigurationPatchSettingsAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationPatchSettingsAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.LinuxVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); @@ -341,10 +341,6 @@ internal VirtualMachineScaleSetOSProfile(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowConfigurationEnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("WindowConfigurationEnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowConfigurationEnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("WinRmListener")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); - } if (content.Contains("LinuxConfigurationSsh")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationSsh = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ISshConfiguration) content.GetValueForProperty("LinuxConfigurationSsh",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationSsh, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshConfigurationTypeConverter.ConvertFrom); @@ -365,10 +361,6 @@ internal VirtualMachineScaleSetOSProfile(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationEnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("LinuxConfigurationEnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationEnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshPublicKeyTypeConverter.ConvertFrom)); - } if (content.Contains("WindowsConfigurationPatchSettingsAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("WindowsConfigurationPatchSettingsAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WindowsVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); @@ -385,6 +377,14 @@ internal VirtualMachineScaleSetOSProfile(global::System.Management.Automation.PS { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAssessmentMode = (string) content.GetValueForProperty("WindowsConfigurationPatchSettingsAssessmentMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WindowsConfigurationPatchSettingsAssessmentMode, global::System.Convert.ToString); } + if (content.Contains("WinRmListener")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } if (content.Contains("LinuxConfigurationPatchSettingsAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationPatchSettingsAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ILinuxVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("LinuxConfigurationPatchSettingsAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetOSProfileInternal)this).LinuxConfigurationPatchSettingsAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.LinuxVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.PowerShell.cs index b7d7260466e..5185913d2c6 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.PowerShell.cs @@ -144,10 +144,6 @@ internal VirtualMachineScaleSetPublicIPAddressConfiguration(global::System.Colle { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).Name, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -160,6 +156,10 @@ internal VirtualMachineScaleSetPublicIPAddressConfiguration(global::System.Colle { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); @@ -217,10 +217,6 @@ internal VirtualMachineScaleSetPublicIPAddressConfiguration(global::System.Manag { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).Name, global::System.Convert.ToString); } - if (content.Contains("IPTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); - } if (content.Contains("DnsSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).DnsSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings) content.GetValueForProperty("DnsSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).DnsSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsTypeConverter.ConvertFrom); @@ -233,6 +229,10 @@ internal VirtualMachineScaleSetPublicIPAddressConfiguration(global::System.Manag { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } + if (content.Contains("IPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag = (System.Collections.Generic.List) content.GetValueForProperty("IPTag",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).IPTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VirtualMachineScaleSetIPTagTypeConverter.ConvertFrom)); + } if (content.Contains("PublicIPAddressVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).PublicIPAddressVersion = (string) content.GetValueForProperty("PublicIPAddressVersion",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVirtualMachineScaleSetPublicIPAddressConfigurationInternal)this).PublicIPAddressVersion, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/WindowsConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/WindowsConfiguration.PowerShell.cs index 1cf1d776306..e0475e5c61d 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/WindowsConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/WindowsConfiguration.PowerShell.cs @@ -152,10 +152,6 @@ internal WindowsConfiguration(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).EnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("EnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).EnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("WinRmListener")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); - } if (content.Contains("PatchSettingAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("PatchSettingAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WindowsVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); @@ -172,6 +168,10 @@ internal WindowsConfiguration(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAssessmentMode = (string) content.GetValueForProperty("PatchSettingAssessmentMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAssessmentMode, global::System.Convert.ToString); } + if (content.Contains("WinRmListener")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); + } if (content.Contains("AutomaticByPlatformSettingRebootSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).AutomaticByPlatformSettingRebootSetting = (string) content.GetValueForProperty("AutomaticByPlatformSettingRebootSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).AutomaticByPlatformSettingRebootSetting, global::System.Convert.ToString); @@ -225,10 +225,6 @@ internal WindowsConfiguration(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).EnableVMAgentPlatformUpdate = (bool?) content.GetValueForProperty("EnableVMAgentPlatformUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).EnableVMAgentPlatformUpdate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } - if (content.Contains("WinRmListener")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); - } if (content.Contains("PatchSettingAutomaticByPlatformSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAutomaticByPlatformSetting = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsVMGuestPatchAutomaticByPlatformSettings) content.GetValueForProperty("PatchSettingAutomaticByPlatformSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAutomaticByPlatformSetting, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WindowsVMGuestPatchAutomaticByPlatformSettingsTypeConverter.ConvertFrom); @@ -245,6 +241,10 @@ internal WindowsConfiguration(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAssessmentMode = (string) content.GetValueForProperty("PatchSettingAssessmentMode",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).PatchSettingAssessmentMode, global::System.Convert.ToString); } + if (content.Contains("WinRmListener")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener = (System.Collections.Generic.List) content.GetValueForProperty("WinRmListener",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).WinRmListener, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.WinRmListenerTypeConverter.ConvertFrom)); + } if (content.Contains("AutomaticByPlatformSettingRebootSetting")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).AutomaticByPlatformSettingRebootSetting = (string) content.GetValueForProperty("AutomaticByPlatformSettingRebootSetting",((Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IWindowsConfigurationInternal)this).AutomaticByPlatformSettingRebootSetting, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateExpanded.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateExpanded.cs index 35d6d09b405..eb72a604eaf 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateExpanded.cs @@ -451,8 +451,8 @@ public partial class NewAzComputeFleet_CreateExpanded : global::System.Managemen ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateViaIdentityExpanded.cs index 0416426efaa..953556e6ff0 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/NewAzComputeFleet_CreateViaIdentityExpanded.cs @@ -411,8 +411,8 @@ public partial class NewAzComputeFleet_CreateViaIdentityExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/SetAzComputeFleet_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/SetAzComputeFleet_UpdateExpanded.cs index 8f825cccf8b..c4506890490 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/SetAzComputeFleet_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/SetAzComputeFleet_UpdateExpanded.cs @@ -452,8 +452,8 @@ public partial class SetAzComputeFleet_UpdateExpanded : global::System.Managemen ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateExpanded.cs index 837795eaed7..3d8c37f72a8 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateExpanded.cs @@ -440,8 +440,8 @@ public partial class UpdateAzComputeFleet_UpdateExpanded : global::System.Manage ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -837,7 +837,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Zone"))) { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateViaIdentityExpanded.cs index a08e6356e5a..74ada70fdf8 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/cmdlets/UpdateAzComputeFleet_UpdateViaIdentityExpanded.cs @@ -400,8 +400,8 @@ public partial class UpdateAzComputeFleet_UpdateViaIdentityExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -817,7 +817,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Zone"))) { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.PowerShell.cs index 39137201649..d7f89ee5971 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.PowerShell.cs @@ -123,7 +123,7 @@ internal AzureLargeInstance(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -268,7 +268,7 @@ internal AzureLargeInstance(global::System.Management.Automation.PSObject conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.cs index ad9a67eaeb9..2c2c131dc30 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstance.cs @@ -188,7 +188,7 @@ public partial class AzureLargeInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.PowerShell.cs index 232181bb09d..0722072b4cb 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.PowerShell.cs @@ -76,7 +76,7 @@ internal AzureLargeInstanceTagsUpdate(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeInstanceTagsUpdateTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -97,7 +97,7 @@ internal AzureLargeInstanceTagsUpdate(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeInstanceTagsUpdateTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.cs index 2aed6e617a0..65b43d5a6b6 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.cs @@ -12,11 +12,11 @@ public partial class AzureLargeInstanceTagsUpdate : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeInstanceTagsUpdateTags()); set => this._tag = value; } /// Creates an new instance. public AzureLargeInstanceTagsUpdate() @@ -37,8 +37,8 @@ public partial interface IAzureLargeInstanceTagsUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags Tag { get; set; } } /// The type used for updating tags in AzureLargeInstance resources. @@ -46,7 +46,7 @@ internal partial interface IAzureLargeInstanceTagsUpdateInternal { /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.json.cs index 4ec672baef8..17c76c4983d 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdate.json.cs @@ -63,7 +63,7 @@ internal AzureLargeInstanceTagsUpdate(Microsoft.Azure.PowerShell.Cmdlets.AzureLa { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeInstanceTagsUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.PowerShell.cs similarity index 78% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.PowerShell.cs index 3dafe6e7c86..28d79521fe4 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models { using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AzureLargeInstanceTagsUpdateTagsTypeConverter))] + public partial class AzureLargeInstanceTagsUpdateTags { /// @@ -61,37 +61,77 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureLargeInstanceTagsUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureLargeInstanceTagsUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new AzureLargeInstanceTagsUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new AzureLargeInstanceTagsUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -109,48 +149,10 @@ public override string ToString() } return ToJsonString(); } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AzureLargeInstanceTagsUpdateTagsTypeConverter))] + public partial interface IAzureLargeInstanceTagsUpdateTags { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.TypeConverter.cs similarity index 82% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.TypeConverter.cs index f63abb8003c..cf8f1cec697 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class AzureLargeInstanceTagsUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return AzureLargeInstanceTagsUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +126,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUser } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return AzureLargeInstanceTagsUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return AzureLargeInstanceTagsUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.cs new file mode 100644 index 00000000000..659e759ae8c --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + /// Resource tags. + public partial class AzureLargeInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTagsInternal + { + + /// Creates an new instance. + public AzureLargeInstanceTagsUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IAzureLargeInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IAzureLargeInstanceTagsUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.dictionary.cs new file mode 100644 index 00000000000..208532814bc --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + public partial class AzureLargeInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeInstanceTagsUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.json.cs new file mode 100644 index 00000000000..beb53dba512 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeInstanceTagsUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + /// Resource tags. + public partial class AzureLargeInstanceTagsUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureLargeInstanceTagsUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new AzureLargeInstanceTagsUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.PowerShell.cs index bc1b5fc7efa..eed91132527 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.PowerShell.cs @@ -127,7 +127,7 @@ internal AzureLargeStorageInstance(global::System.Collections.IDictionary conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -159,7 +159,7 @@ internal AzureLargeStorageInstance(global::System.Collections.IDictionary conten } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("StoragePropertyStorageBillingProperty")) { @@ -260,7 +260,7 @@ internal AzureLargeStorageInstance(global::System.Management.Automation.PSObject } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -292,7 +292,7 @@ internal AzureLargeStorageInstance(global::System.Management.Automation.PSObject } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("StoragePropertyStorageBillingProperty")) { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.cs index 2cf9b2db250..73e626e0a9c 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstance.cs @@ -51,7 +51,7 @@ public partial class AzureLargeStorageInstance : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Inherited)] @@ -184,7 +184,7 @@ public partial class AzureLargeStorageInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -267,8 +267,8 @@ public partial interface IAzureLargeStorageInstance : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// the billing mode for the storage instance [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Info( Required = false, @@ -391,7 +391,7 @@ internal partial interface IAzureLargeStorageInstanceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceProperties Property { get; set; } /// the billing mode for the storage instance diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.PowerShell.cs index f2097e75d1c..432abab84e8 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.PowerShell.cs @@ -80,7 +80,7 @@ internal AzureLargeStorageInstanceTagsUpdate(global::System.Collections.IDiction } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeStorageInstanceTagsUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -96,7 +96,7 @@ internal AzureLargeStorageInstanceTagsUpdate(global::System.Collections.IDiction } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -121,7 +121,7 @@ internal AzureLargeStorageInstanceTagsUpdate(global::System.Management.Automatio } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeStorageInstanceTagsUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -137,7 +137,7 @@ internal AzureLargeStorageInstanceTagsUpdate(global::System.Management.Automatio } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.cs index badd25a85e2..c31fe7f0e44 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.cs @@ -36,7 +36,7 @@ public partial class AzureLargeStorageInstanceTagsUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentity()); set { {_identity = value;} } } @@ -48,11 +48,11 @@ public partial class AzureLargeStorageInstanceTagsUpdate : string Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeStorageInstanceTagsUpdateTags()); set => this._tag = value; } /// Creates an new instance. public AzureLargeStorageInstanceTagsUpdate() @@ -111,8 +111,8 @@ public partial interface IAzureLargeStorageInstanceTagsUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Info( Required = false, @@ -122,8 +122,8 @@ public partial interface IAzureLargeStorageInstanceTagsUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags Tag { get; set; } } /// The type used for updating tags in AzureLargeStorageInstance resources. @@ -144,9 +144,9 @@ internal partial interface IAzureLargeStorageInstanceTagsUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.json.cs index cc4a3418f77..a0dab4333e0 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdate.json.cs @@ -64,7 +64,7 @@ internal AzureLargeStorageInstanceTagsUpdate(Microsoft.Azure.PowerShell.Cmdlets. return; } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeStorageInstanceTagsUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.PowerShell.cs new file mode 100644 index 00000000000..83f00452481 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AzureLargeStorageInstanceTagsUpdateTagsTypeConverter))] + public partial class AzureLargeStorageInstanceTagsUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureLargeStorageInstanceTagsUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureLargeStorageInstanceTagsUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureLargeStorageInstanceTagsUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureLargeStorageInstanceTagsUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AzureLargeStorageInstanceTagsUpdateTagsTypeConverter))] + public partial interface IAzureLargeStorageInstanceTagsUpdateTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.TypeConverter.cs new file mode 100644 index 00000000000..932870a60c1 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureLargeStorageInstanceTagsUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureLargeStorageInstanceTagsUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureLargeStorageInstanceTagsUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureLargeStorageInstanceTagsUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.cs new file mode 100644 index 00000000000..dda6bfacea3 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + /// Resource tags. + public partial class AzureLargeStorageInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTagsInternal + { + + /// Creates an new instance. + public AzureLargeStorageInstanceTagsUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IAzureLargeStorageInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IAzureLargeStorageInstanceTagsUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.dictionary.cs new file mode 100644 index 00000000000..812b98165e0 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + public partial class AzureLargeStorageInstanceTagsUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.AzureLargeStorageInstanceTagsUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.json.cs new file mode 100644 index 00000000000..d201ccfead5 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/AzureLargeStorageInstanceTagsUpdateTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; + + /// Resource tags. + public partial class AzureLargeStorageInstanceTagsUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AzureLargeStorageInstanceTagsUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeStorageInstanceTagsUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new AzureLargeStorageInstanceTagsUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index c63acf94e04..1ad6dc5abe5 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index c59dc70f89d..f5ce3ab95ef 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 542a7a7178a..9ea76d4290a 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index e824e4c5c0b..ec6deed1221 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeIns {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..5266b2a1147 --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..f5fd79326ff --- /dev/null +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 084027503d8..37f25cc2ac0 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index 7a9f9ee38a3..9cc899aeab0 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index eb633f06dd1..0330f996cc0 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs index 7536b1abe73..ac3afa9a9d9 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs @@ -143,14 +143,6 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -163,6 +155,14 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -216,14 +216,6 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -236,6 +228,14 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index aebecb6abd8..9c07ed95c41 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.cs index 1e779a35de0..517d9de27c6 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.cs @@ -97,11 +97,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -152,8 +152,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -163,7 +163,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.json.cs index 1bb031941c1..64a6970e5b7 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.R return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 81% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 606c3e2a902..8b46041e149 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index fc83dc7b46b..16adea061b6 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.cs index 0fd9a316e4f..e51896f47f9 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index d63239251c9..51551b40301 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs index c3df12e5df7..4cda5028fdf 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,42 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new Tags(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.SerializationMode serializationMode) { @@ -103,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateExpanded.cs index 096431f6ce6..746f3ee869f 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateExpanded.cs @@ -352,8 +352,8 @@ public partial class NewAzAzureLargeInstanceAzureLargeInstance_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateViaIdentityExpanded.cs index 703e8ccb9df..9bfc71cd94c 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeInstance_CreateViaIdentityExpanded.cs @@ -312,8 +312,8 @@ public partial class NewAzAzureLargeInstanceAzureLargeInstance_CreateViaIdentity ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateExpanded.cs index cc11b9dbd5c..b5d52fe3a68 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateExpanded.cs @@ -296,8 +296,8 @@ public partial class NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateExpa ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateViaIdentityExpanded.cs index 2df7602a4a2..90fbeb45360 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateViaIdentityExpanded.cs @@ -256,8 +256,8 @@ public partial class NewAzAzureLargeInstanceAzureLargeStorageInstance_CreateViaI ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateExpanded.cs index 644c5f6c38e..b52836f1d82 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateExpanded.cs @@ -177,8 +177,8 @@ public partial class UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateViaIdentityExpanded.cs index e63b7bd441b..d33655afc0e 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateViaIdentityExpanded.cs @@ -137,8 +137,8 @@ public partial class UpdateAzAzureLargeInstanceAzureLargeInstance_UpdateViaIdent ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.IAzureLargeInstanceTagsUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateExpanded.cs index b64f921cc86..a4430e8a828 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateExpanded.cs @@ -285,8 +285,8 @@ public partial class UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateE ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -595,7 +595,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AzureLargeStorageInstanceUniqueIdentifier"))) { diff --git a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateViaIdentityExpanded.cs index 965bba18e8a..87125e2018b 100644 --- a/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/AzureLargeInstance.Management/target/generated/cmdlets/UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateViaIdentityExpanded.cs @@ -245,8 +245,8 @@ public partial class UpdateAzAzureLargeInstanceAzureLargeStorageInstance_UpdateV ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -578,7 +578,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.AzureLargeInstance.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AzureLargeStorageInstanceUniqueIdentifier"))) { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CertificateProfile.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CertificateProfile.PowerShell.cs index 41151b60bd6..edfb3dd8132 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CertificateProfile.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CertificateProfile.PowerShell.cs @@ -130,10 +130,6 @@ internal CertificateProfile(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate = (System.Collections.Generic.List) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CertificateTypeConverter.ConvertFrom)); - } if (content.Contains("IncludeStreetAddress")) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).IncludeStreetAddress = (bool?) content.GetValueForProperty("IncludeStreetAddress",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).IncludeStreetAddress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); @@ -162,6 +158,10 @@ internal CertificateProfile(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate = (System.Collections.Generic.List) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CertificateTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -235,10 +235,6 @@ internal CertificateProfile(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("Certificate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate = (System.Collections.Generic.List) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CertificateTypeConverter.ConvertFrom)); - } if (content.Contains("IncludeStreetAddress")) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).IncludeStreetAddress = (bool?) content.GetValueForProperty("IncludeStreetAddress",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).IncludeStreetAddress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); @@ -267,6 +263,10 @@ internal CertificateProfile(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Status, global::System.Convert.ToString); } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate = (System.Collections.Generic.List) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICertificateProfileInternal)this).Certificate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CertificateTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.PowerShell.cs index 1cc3bc03a01..ded2cfc5afc 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.PowerShell.cs @@ -124,7 +124,7 @@ internal CodeSigningAccount(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -213,7 +213,7 @@ internal CodeSigningAccount(global::System.Management.Automation.PSObject conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.cs index 73144b9771a..05d1a4f6d16 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccount.cs @@ -135,7 +135,7 @@ public partial class CodeSigningAccount : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Origin(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.PowerShell.cs index 699b6c80cb7..941e6ae9e4a 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.PowerShell.cs @@ -80,7 +80,7 @@ internal CodeSigningAccountPatch(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchTagsTypeConverter.ConvertFrom); } if (content.Contains("Sku")) { @@ -113,7 +113,7 @@ internal CodeSigningAccountPatch(global::System.Management.Automation.PSObject c } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchTagsTypeConverter.ConvertFrom); } if (content.Contains("Sku")) { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.cs index bbb6e258677..507a982c9b4 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.cs @@ -29,11 +29,11 @@ public partial class CodeSigningAccountPatch : public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchPropertiesInternal)Property).SkuName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Origin(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchTags()); set => this._tag = value; } /// Creates an new instance. public CodeSigningAccountPatch() @@ -66,8 +66,8 @@ public partial interface ICodeSigningAccountPatch : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags Tag { get; set; } } /// Parameters for creating or updating a trusted signing account. @@ -82,7 +82,7 @@ internal partial interface ICodeSigningAccountPatchInternal [global::Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.PSArgumentCompleterAttribute("Basic", "Premium")] string SkuName { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.json.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.json.cs index b49d12f357c..d804d8db285 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.json.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatch.json.cs @@ -64,7 +64,7 @@ internal CodeSigningAccountPatch(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning. return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.PowerShell.cs new file mode 100644 index 00000000000..01c82e9b6eb --- /dev/null +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(CodeSigningAccountPatchTagsTypeConverter))] + public partial class CodeSigningAccountPatchTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CodeSigningAccountPatchTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CodeSigningAccountPatchTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CodeSigningAccountPatchTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CodeSigningAccountPatchTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(CodeSigningAccountPatchTagsTypeConverter))] + public partial interface ICodeSigningAccountPatchTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.TypeConverter.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.TypeConverter.cs new file mode 100644 index 00000000000..3bfe2d32b90 --- /dev/null +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.TypeConverter.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CodeSigningAccountPatchTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CodeSigningAccountPatchTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CodeSigningAccountPatchTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CodeSigningAccountPatchTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.cs new file mode 100644 index 00000000000..b52d9e41322 --- /dev/null +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; + + /// Resource tags. + public partial class CodeSigningAccountPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags, + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTagsInternal + { + + /// Creates an new instance. + public CodeSigningAccountPatchTags() + { + + } + } + /// Resource tags. + public partial interface ICodeSigningAccountPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ICodeSigningAccountPatchTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.dictionary.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.dictionary.cs new file mode 100644 index 00000000000..43081341388 --- /dev/null +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; + + public partial class CodeSigningAccountPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.CodeSigningAccountPatchTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.json.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.json.cs new file mode 100644 index 00000000000..4071ee26f36 --- /dev/null +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/CodeSigningAccountPatchTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; + + /// Resource tags. + public partial class CodeSigningAccountPatchTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject instance to deserialize from. + /// + internal CodeSigningAccountPatchTags(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json ? new CodeSigningAccountPatchTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index cf35bba7d93..6f98f949bb7 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 047ef4df994..31b6f6bd357 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.cs index f227895e549..7e3f3ccd9cc 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Origin(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.json.cs index 5da439bdfc0..c997bebd6c9 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime. return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index e3d46132489..1e6e534eee5 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models using Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index d09b5141c4d..06e22b07c0a 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models using Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Conver } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.cs index 6e5afeb553f..a7b290dcbb4 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 089b5326771..d1dd0987de8 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models { using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 8af2cc7f2ae..bc627ac9b40 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models using static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonNode ToJs AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateExpanded.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateExpanded.cs index f60e009cbdb..db5163800b4 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateExpanded.cs @@ -201,8 +201,8 @@ public partial class NewAzCodeSigningAccount_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateViaIdentityExpanded.cs index 451e6574877..f57b91fdc8b 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/NewAzCodeSigningAccount_CreateViaIdentityExpanded.cs @@ -162,8 +162,8 @@ public partial class NewAzCodeSigningAccount_CreateViaIdentityExpanded : global: ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateExpanded.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateExpanded.cs index 788cff43f4f..73371d16f0e 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateExpanded.cs @@ -190,8 +190,8 @@ public partial class UpdateAzCodeSigningAccount_UpdateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateViaIdentityExpanded.cs index 3bd09c6be93..59a1fb2cfd2 100644 --- a/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/CodeSigning.Management/target/generated/cmdlets/UpdateAzCodeSigningAccount_UpdateViaIdentityExpanded.cs @@ -151,8 +151,8 @@ public partial class UpdateAzCodeSigningAccount_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.CodeSigning.Models.ICodeSigningAccountPatchTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/ComputeSchedule.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/ComputeSchedule.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index ee0aaab346b..7141098a9a3 100644 --- a/tests-upgrade/tests-emitter/ComputeSchedule.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/ComputeSchedule.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ComputeSchedule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.PowerShell.cs index 0aee5ff4b09..432727899f1 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.PowerShell.cs @@ -132,7 +132,7 @@ internal Asset(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -142,18 +142,6 @@ internal Asset(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Version = (long?) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Version, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("Attribute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -222,6 +210,10 @@ internal Asset(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).SerialNumber, global::System.Convert.ToString); } + if (content.Contains("Attribute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributesTypeConverter.ConvertFrom); + } if (content.Contains("DiscoveredAssetRef")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DiscoveredAssetRef = (System.Collections.Generic.List) content.GetValueForProperty("DiscoveredAssetRef",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DiscoveredAssetRef, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -234,21 +226,17 @@ internal Asset(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultEventsConfiguration = (string) content.GetValueForProperty("DefaultEventsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultEventsConfiguration, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); - } - if (content.Contains("StatusVersion")) + if (content.Contains("Dataset")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); } - if (content.Contains("StatusDataset")) + if (content.Contains("Event")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); } - if (content.Contains("StatusEvent")) + if (content.Contains("StatusVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ExtendedLocationType")) { @@ -266,6 +254,18 @@ internal Asset(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultTopicRetain = (string) content.GetValueForProperty("DefaultTopicRetain",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultTopicRetain, global::System.Convert.ToString); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusDataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusEvent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -341,7 +341,7 @@ internal Asset(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -351,18 +351,6 @@ internal Asset(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Version = (long?) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Version, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("Attribute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -431,6 +419,10 @@ internal Asset(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).SerialNumber, global::System.Convert.ToString); } + if (content.Contains("Attribute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributesTypeConverter.ConvertFrom); + } if (content.Contains("DiscoveredAssetRef")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DiscoveredAssetRef = (System.Collections.Generic.List) content.GetValueForProperty("DiscoveredAssetRef",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DiscoveredAssetRef, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -443,21 +435,17 @@ internal Asset(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultEventsConfiguration = (string) content.GetValueForProperty("DefaultEventsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultEventsConfiguration, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); - } - if (content.Contains("StatusVersion")) + if (content.Contains("Dataset")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); } - if (content.Contains("StatusDataset")) + if (content.Contains("Event")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); } - if (content.Contains("StatusEvent")) + if (content.Contains("StatusVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ExtendedLocationType")) { @@ -475,6 +463,18 @@ internal Asset(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultTopicRetain = (string) content.GetValueForProperty("DefaultTopicRetain",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).DefaultTopicRetain, global::System.Convert.ToString); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusDataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusEvent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.cs index b0280e6e276..e32456be07d 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Asset.cs @@ -20,7 +20,7 @@ public partial class Asset : /// A set of key-value pairs that contain custom attributes set by the customer. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)Property).Attribute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)Property).Attribute = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)Property).Attribute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)Property).Attribute = value ?? null /* model class */; } /// Backing field for property. private string _azureAsyncOperation; @@ -291,7 +291,7 @@ public partial class Asset : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -352,8 +352,8 @@ public partial interface IAsset : Update = true, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Info( Required = false, @@ -726,7 +726,7 @@ internal partial interface IAssetInternal : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal { /// A set of key-value pairs that contain custom attributes set by the customer. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get; set; } string AzureAsyncOperation { get; set; } /// diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.PowerShell.cs index 6b7b53d955c..5b652d1b434 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.PowerShell.cs @@ -132,7 +132,7 @@ internal AssetEndpointProfile(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -178,10 +178,6 @@ internal AssetEndpointProfile(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationMethod, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("ExtendedLocationType")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).ExtendedLocationType, global::System.Convert.ToString); @@ -194,6 +190,10 @@ internal AssetEndpointProfile(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationUsernamePasswordCredentials = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IUsernamePasswordCredentials) content.GetValueForProperty("AuthenticationUsernamePasswordCredentials",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationUsernamePasswordCredentials, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.UsernamePasswordCredentialsTypeConverter.ConvertFrom); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); + } if (content.Contains("UsernamePasswordCredentialsUsernameSecretName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).UsernamePasswordCredentialsUsernameSecretName = (string) content.GetValueForProperty("UsernamePasswordCredentialsUsernameSecretName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).UsernamePasswordCredentialsUsernameSecretName, global::System.Convert.ToString); @@ -281,7 +281,7 @@ internal AssetEndpointProfile(global::System.Management.Automation.PSObject cont } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -327,10 +327,6 @@ internal AssetEndpointProfile(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationMethod, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("ExtendedLocationType")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).ExtendedLocationType, global::System.Convert.ToString); @@ -343,6 +339,10 @@ internal AssetEndpointProfile(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationUsernamePasswordCredentials = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IUsernamePasswordCredentials) content.GetValueForProperty("AuthenticationUsernamePasswordCredentials",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).AuthenticationUsernamePasswordCredentials, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.UsernamePasswordCredentialsTypeConverter.ConvertFrom); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); + } if (content.Contains("UsernamePasswordCredentialsUsernameSecretName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).UsernamePasswordCredentialsUsernameSecretName = (string) content.GetValueForProperty("UsernamePasswordCredentialsUsernameSecretName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileInternal)this).UsernamePasswordCredentialsUsernameSecretName, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.cs index 0f09508565f..27928b8a86c 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfile.cs @@ -190,7 +190,7 @@ public partial class AssetEndpointProfile : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileProperties.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileProperties.PowerShell.cs index a6ad6bf7db6..e4512caf801 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileProperties.PowerShell.cs @@ -114,14 +114,14 @@ internal AssetEndpointProfileProperties(global::System.Collections.IDictionary c { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationMethod, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("AuthenticationUsernamePasswordCredentials")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationUsernamePasswordCredentials = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IUsernamePasswordCredentials) content.GetValueForProperty("AuthenticationUsernamePasswordCredentials",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationUsernamePasswordCredentials, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.UsernamePasswordCredentialsTypeConverter.ConvertFrom); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); + } if (content.Contains("UsernamePasswordCredentialsUsernameSecretName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).UsernamePasswordCredentialsUsernameSecretName = (string) content.GetValueForProperty("UsernamePasswordCredentialsUsernameSecretName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).UsernamePasswordCredentialsUsernameSecretName, global::System.Convert.ToString); @@ -191,14 +191,14 @@ internal AssetEndpointProfileProperties(global::System.Management.Automation.PSO { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationMethod, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("AuthenticationUsernamePasswordCredentials")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationUsernamePasswordCredentials = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IUsernamePasswordCredentials) content.GetValueForProperty("AuthenticationUsernamePasswordCredentials",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).AuthenticationUsernamePasswordCredentials, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.UsernamePasswordCredentialsTypeConverter.ConvertFrom); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileStatusErrorTypeConverter.ConvertFrom)); + } if (content.Contains("UsernamePasswordCredentialsUsernameSecretName")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).UsernamePasswordCredentialsUsernameSecretName = (string) content.GetValueForProperty("UsernamePasswordCredentialsUsernameSecretName",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfilePropertiesInternal)this).UsernamePasswordCredentialsUsernameSecretName, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.PowerShell.cs index afc9db04856..7aeeef8c526 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.PowerShell.cs @@ -80,7 +80,7 @@ internal AssetEndpointProfileUpdate(global::System.Collections.IDictionary conte } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Authentication")) { @@ -145,7 +145,7 @@ internal AssetEndpointProfileUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Authentication")) { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.cs index a2494f50404..2e9bde81d13 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.cs @@ -47,11 +47,11 @@ public partial class AssetEndpointProfileUpdate : internal Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateTags()); set => this._tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress @@ -131,8 +131,8 @@ public partial interface IAssetEndpointProfileUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags Tag { get; set; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress /// URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. @@ -212,7 +212,7 @@ internal partial interface IAssetEndpointProfileUpdateInternal /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateProperties Property { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags Tag { get; set; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress /// URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.json.cs index d2b445dde5b..f5052aea181 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdate.json.cs @@ -64,7 +64,7 @@ internal AssetEndpointProfileUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceReg return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.PowerShell.cs new file mode 100644 index 00000000000..e95b4444327 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AssetEndpointProfileUpdateTagsTypeConverter))] + public partial class AssetEndpointProfileUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AssetEndpointProfileUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AssetEndpointProfileUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AssetEndpointProfileUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AssetEndpointProfileUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(AssetEndpointProfileUpdateTagsTypeConverter))] + public partial interface IAssetEndpointProfileUpdateTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.TypeConverter.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.TypeConverter.cs new file mode 100644 index 00000000000..d4fc3e2bf83 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AssetEndpointProfileUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AssetEndpointProfileUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AssetEndpointProfileUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AssetEndpointProfileUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.cs new file mode 100644 index 00000000000..a72c4970a68 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// Resource tags. + public partial class AssetEndpointProfileUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTagsInternal + { + + /// Creates an new instance. + public AssetEndpointProfileUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IAssetEndpointProfileUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IAssetEndpointProfileUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.dictionary.cs new file mode 100644 index 00000000000..9a6b29a20c0 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + public partial class AssetEndpointProfileUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetEndpointProfileUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.json.cs new file mode 100644 index 00000000000..83ddd492dd3 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetEndpointProfileUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// Resource tags. + public partial class AssetEndpointProfileUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AssetEndpointProfileUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new AssetEndpointProfileUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.PowerShell.cs index f85fec58efe..a96a5dab808 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.PowerShell.cs @@ -144,7 +144,7 @@ internal AssetProperties(global::System.Collections.IDictionary content) } if (content.Contains("Attribute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributesTypeConverter.ConvertFrom); } if (content.Contains("DiscoveredAssetRef")) { @@ -170,22 +170,10 @@ internal AssetProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("StatusVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("StatusDataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("StatusEvent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); - } if (content.Contains("DefaultTopicPath")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicPath = (string) content.GetValueForProperty("DefaultTopicPath",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicPath, global::System.Convert.ToString); @@ -194,6 +182,18 @@ internal AssetProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicRetain = (string) content.GetValueForProperty("DefaultTopicRetain",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicRetain, global::System.Convert.ToString); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusDataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusEvent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -281,7 +281,7 @@ internal AssetProperties(global::System.Management.Automation.PSObject content) } if (content.Contains("Attribute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributesTypeConverter.ConvertFrom); } if (content.Contains("DiscoveredAssetRef")) { @@ -307,22 +307,10 @@ internal AssetProperties(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("StatusError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); - } if (content.Contains("StatusVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusVersion = (long?) content.GetValueForProperty("StatusVersion",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusVersion, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } - if (content.Contains("StatusDataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("StatusEvent")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); - } if (content.Contains("DefaultTopicPath")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicPath = (string) content.GetValueForProperty("DefaultTopicPath",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicPath, global::System.Convert.ToString); @@ -331,6 +319,18 @@ internal AssetProperties(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicRetain = (string) content.GetValueForProperty("DefaultTopicRetain",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).DefaultTopicRetain, global::System.Convert.ToString); } + if (content.Contains("StatusError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError = (System.Collections.Generic.List) content.GetValueForProperty("StatusError",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusErrorTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusDataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset = (System.Collections.Generic.List) content.GetValueForProperty("StatusDataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusDataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusDatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("StatusEvent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent = (System.Collections.Generic.List) content.GetValueForProperty("StatusEvent",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesInternal)this).StatusEvent, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetStatusEventTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.cs index f17065516b5..d51ac6f3f27 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.cs @@ -22,11 +22,11 @@ public partial class AssetProperties : public string AssetEndpointProfileRef { get => this._assetEndpointProfileRef; set => this._assetEndpointProfileRef = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes _attribute; + private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes _attribute; /// A set of key-value pairs that contain custom attributes set by the customer. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => (this._attribute = this._attribute ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Attributes()); set => this._attribute = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get => (this._attribute = this._attribute ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributes()); set => this._attribute = value; } /// Backing field for property. private System.Collections.Generic.List _dataset; @@ -287,8 +287,8 @@ public partial interface IAssetProperties : Update = true, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// @@ -608,7 +608,7 @@ internal partial interface IAssetPropertiesInternal /// string AssetEndpointProfileRef { get; set; } /// A set of key-value pairs that contain custom attributes set by the customer. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.json.cs index 06616400aa9..b6b2bc28b34 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetProperties.json.cs @@ -80,7 +80,7 @@ internal AssetProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runti {_softwareRevision = If( json?.PropertyT("softwareRevision"), out var __jsonSoftwareRevision) ? (string)__jsonSoftwareRevision : (string)_softwareRevision;} {_documentationUri = If( json?.PropertyT("documentationUri"), out var __jsonDocumentationUri) ? (string)__jsonDocumentationUri : (string)_documentationUri;} {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} - {_attribute = If( json?.PropertyT("attributes"), out var __jsonAttributes) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Attributes.FromJson(__jsonAttributes) : _attribute;} + {_attribute = If( json?.PropertyT("attributes"), out var __jsonAttributes) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributes.FromJson(__jsonAttributes) : _attribute;} {_discoveredAssetRef = If( json?.PropertyT("discoveredAssetRefs"), out var __jsonDiscoveredAssetRefs) ? If( __jsonDiscoveredAssetRefs as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _discoveredAssetRef;} {_defaultDatasetsConfiguration = If( json?.PropertyT("defaultDatasetsConfiguration"), out var __jsonDefaultDatasetsConfiguration) ? (string)__jsonDefaultDatasetsConfiguration : (string)_defaultDatasetsConfiguration;} {_defaultEventsConfiguration = If( json?.PropertyT("defaultEventsConfiguration"), out var __jsonDefaultEventsConfiguration) ? (string)__jsonDefaultEventsConfiguration : (string)_defaultEventsConfiguration;} diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.PowerShell.cs new file mode 100644 index 00000000000..b89e3816ccc --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// A set of key-value pairs that contain custom attributes set by the customer. + [System.ComponentModel.TypeConverter(typeof(AssetPropertiesAttributesTypeConverter))] + public partial class AssetPropertiesAttributes + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AssetPropertiesAttributes(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AssetPropertiesAttributes(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AssetPropertiesAttributes(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AssetPropertiesAttributes(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// A set of key-value pairs that contain custom attributes set by the customer. + [System.ComponentModel.TypeConverter(typeof(AssetPropertiesAttributesTypeConverter))] + public partial interface IAssetPropertiesAttributes + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.TypeConverter.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.TypeConverter.cs new file mode 100644 index 00000000000..c1ea030c55c --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.TypeConverter.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AssetPropertiesAttributesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AssetPropertiesAttributes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AssetPropertiesAttributes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AssetPropertiesAttributes.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.cs similarity index 73% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.cs index 3741f7ee4ab..9f8035a3470 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; /// A set of key-value pairs that contain custom attributes set by the customer. - public partial class Attributes : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributesInternal + public partial class AssetPropertiesAttributes : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributesInternal { - /// Creates an new instance. - public Attributes() + /// Creates an new instance. + public AssetPropertiesAttributes() { } } /// A set of key-value pairs that contain custom attributes set by the customer. - public partial interface IAttributes : + public partial interface IAssetPropertiesAttributes : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray { } /// A set of key-value pairs that contain custom attributes set by the customer. - internal partial interface IAttributesInternal + internal partial interface IAssetPropertiesAttributesInternal { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.dictionary.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.dictionary.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.dictionary.cs index 3984ee3a7cd..ccddd422f90 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.dictionary.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models { using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - public partial class Attributes : + public partial class AssetPropertiesAttributes : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Attributes source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetPropertiesAttributes source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.json.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.json.cs index 20f743764c1..74c65f41dce 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetPropertiesAttributes.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; /// A set of key-value pairs that contain custom attributes set by the customer. - public partial class Attributes + public partial class AssetPropertiesAttributes { /// @@ -52,11 +52,11 @@ public partial class Attributes partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. /// - internal Attributes(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal AssetPropertiesAttributes(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -69,25 +69,25 @@ internal Attributes(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Js } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new Attributes(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new AssetPropertiesAttributes(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.PowerShell.cs index 14a9bf4eff5..f040ec0610b 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.PowerShell.cs @@ -80,19 +80,7 @@ internal AssetUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Attribute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("DefaultTopic")) { @@ -142,6 +130,10 @@ internal AssetUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).SerialNumber, global::System.Convert.ToString); } + if (content.Contains("Attribute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributesTypeConverter.ConvertFrom); + } if (content.Contains("DefaultDatasetsConfiguration")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultDatasetsConfiguration = (string) content.GetValueForProperty("DefaultDatasetsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultDatasetsConfiguration, global::System.Convert.ToString); @@ -150,6 +142,14 @@ internal AssetUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultEventsConfiguration = (string) content.GetValueForProperty("DefaultEventsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultEventsConfiguration, global::System.Convert.ToString); } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); + } if (content.Contains("DefaultTopicPath")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultTopicPath = (string) content.GetValueForProperty("DefaultTopicPath",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultTopicPath, global::System.Convert.ToString); @@ -181,19 +181,7 @@ internal AssetUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Attribute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); - } - if (content.Contains("Dataset")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); - } - if (content.Contains("Event")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("DefaultTopic")) { @@ -243,6 +231,10 @@ internal AssetUpdate(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).SerialNumber, global::System.Convert.ToString); } + if (content.Contains("Attribute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributesTypeConverter.ConvertFrom); + } if (content.Contains("DefaultDatasetsConfiguration")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultDatasetsConfiguration = (string) content.GetValueForProperty("DefaultDatasetsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultDatasetsConfiguration, global::System.Convert.ToString); @@ -251,6 +243,14 @@ internal AssetUpdate(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultEventsConfiguration = (string) content.GetValueForProperty("DefaultEventsConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultEventsConfiguration, global::System.Convert.ToString); } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset = (System.Collections.Generic.List) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Dataset, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.DatasetTypeConverter.ConvertFrom)); + } + if (content.Contains("Event")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event = (System.Collections.Generic.List) content.GetValueForProperty("Event",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).Event, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.EventTypeConverter.ConvertFrom)); + } if (content.Contains("DefaultTopicPath")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultTopicPath = (string) content.GetValueForProperty("DefaultTopicPath",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateInternal)this).DefaultTopicPath, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.cs index 60c28380005..e9e1ca7dcc4 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.cs @@ -13,7 +13,7 @@ public partial class AssetUpdate : /// A set of key-value pairs that contain custom attributes set by the customer. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).Attribute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).Attribute = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).Attribute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).Attribute = value ?? null /* model class */; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. @@ -109,11 +109,11 @@ public partial class AssetUpdate : public string SoftwareRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).SoftwareRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)Property).SoftwareRevision = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateTags()); set => this._tag = value; } /// Creates an new instance. public AssetUpdate() @@ -134,8 +134,8 @@ public partial interface IAssetUpdate : Update = true, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// @@ -345,8 +345,8 @@ public partial interface IAssetUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags Tag { get; set; } } /// The type used for update operations of the Asset. @@ -354,7 +354,7 @@ internal partial interface IAssetUpdateInternal { /// A set of key-value pairs that contain custom attributes set by the customer. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// @@ -407,7 +407,7 @@ internal partial interface IAssetUpdateInternal /// Revision number of the software. string SoftwareRevision { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.json.cs index 4661e79d215..e20d6cee1d1 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdate.json.cs @@ -64,7 +64,7 @@ internal AssetUpdate(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.J return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.PowerShell.cs index 1df5d9bc794..d0c069820bc 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.PowerShell.cs @@ -124,7 +124,7 @@ internal AssetUpdateProperties(global::System.Collections.IDictionary content) } if (content.Contains("Attribute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributesTypeConverter.ConvertFrom); } if (content.Contains("DefaultDatasetsConfiguration")) { @@ -217,7 +217,7 @@ internal AssetUpdateProperties(global::System.Management.Automation.PSObject con } if (content.Contains("Attribute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AttributesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) content.GetValueForProperty("Attribute",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesInternal)this).Attribute, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributesTypeConverter.ConvertFrom); } if (content.Contains("DefaultDatasetsConfiguration")) { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.cs index fa78ca746fd..c230619f752 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.cs @@ -12,11 +12,11 @@ public partial class AssetUpdateProperties : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes _attribute; + private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes _attribute; /// A set of key-value pairs that contain custom attributes set by the customer. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => (this._attribute = this._attribute ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Attributes()); set => this._attribute = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get => (this._attribute = this._attribute ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributes()); set => this._attribute = value; } /// Backing field for property. private System.Collections.Generic.List _dataset; @@ -172,8 +172,8 @@ public partial interface IAssetUpdateProperties : Update = true, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// @@ -381,7 +381,7 @@ internal partial interface IAssetUpdatePropertiesInternal { /// A set of key-value pairs that contain custom attributes set by the customer. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get; set; } /// /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. /// diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.json.cs index 5a07e2a938c..b37a32d3c21 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateProperties.json.cs @@ -75,7 +75,7 @@ internal AssetUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry {_softwareRevision = If( json?.PropertyT("softwareRevision"), out var __jsonSoftwareRevision) ? (string)__jsonSoftwareRevision : (string)_softwareRevision;} {_documentationUri = If( json?.PropertyT("documentationUri"), out var __jsonDocumentationUri) ? (string)__jsonDocumentationUri : (string)_documentationUri;} {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} - {_attribute = If( json?.PropertyT("attributes"), out var __jsonAttributes) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Attributes.FromJson(__jsonAttributes) : _attribute;} + {_attribute = If( json?.PropertyT("attributes"), out var __jsonAttributes) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributes.FromJson(__jsonAttributes) : _attribute;} {_defaultDatasetsConfiguration = If( json?.PropertyT("defaultDatasetsConfiguration"), out var __jsonDefaultDatasetsConfiguration) ? (string)__jsonDefaultDatasetsConfiguration : (string)_defaultDatasetsConfiguration;} {_defaultEventsConfiguration = If( json?.PropertyT("defaultEventsConfiguration"), out var __jsonDefaultEventsConfiguration) ? (string)__jsonDefaultEventsConfiguration : (string)_defaultEventsConfiguration;} {_dataset = If( json?.PropertyT("datasets"), out var __jsonDatasets) ? If( __jsonDatasets as Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IDataset) (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Dataset.FromJson(__u) )) ))() : null : _dataset;} diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.PowerShell.cs new file mode 100644 index 00000000000..62a9c4be69d --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// A set of key-value pairs that contain custom attributes set by the customer. + [System.ComponentModel.TypeConverter(typeof(AssetUpdatePropertiesAttributesTypeConverter))] + public partial class AssetUpdatePropertiesAttributes + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AssetUpdatePropertiesAttributes(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AssetUpdatePropertiesAttributes(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AssetUpdatePropertiesAttributes(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AssetUpdatePropertiesAttributes(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// A set of key-value pairs that contain custom attributes set by the customer. + [System.ComponentModel.TypeConverter(typeof(AssetUpdatePropertiesAttributesTypeConverter))] + public partial interface IAssetUpdatePropertiesAttributes + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.TypeConverter.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.TypeConverter.cs new file mode 100644 index 00000000000..ff451b811b7 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AssetUpdatePropertiesAttributesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AssetUpdatePropertiesAttributes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AssetUpdatePropertiesAttributes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AssetUpdatePropertiesAttributes.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.cs new file mode 100644 index 00000000000..4c957deb163 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// A set of key-value pairs that contain custom attributes set by the customer. + public partial class AssetUpdatePropertiesAttributes : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributesInternal + { + + /// Creates an new instance. + public AssetUpdatePropertiesAttributes() + { + + } + } + /// A set of key-value pairs that contain custom attributes set by the customer. + public partial interface IAssetUpdatePropertiesAttributes : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + + } + /// A set of key-value pairs that contain custom attributes set by the customer. + internal partial interface IAssetUpdatePropertiesAttributesInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.dictionary.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.dictionary.cs new file mode 100644 index 00000000000..0e68ea5432d --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + public partial class AssetUpdatePropertiesAttributes : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdatePropertiesAttributes source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.json.cs new file mode 100644 index 00000000000..d5286b0cd86 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdatePropertiesAttributes.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// A set of key-value pairs that contain custom attributes set by the customer. + public partial class AssetUpdatePropertiesAttributes + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AssetUpdatePropertiesAttributes(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new AssetUpdatePropertiesAttributes(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.PowerShell.cs index c1ef57bd5a8..170f368a7cd 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(AssetUpdateTagsTypeConverter))] + public partial class AssetUpdateTags { /// @@ -61,44 +61,11 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Tags(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Tags(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal AssetUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +80,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal AssetUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -131,6 +98,39 @@ internal Tags(global::System.Management.Automation.PSObject content) AfterDeserializePSObject(content); } + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AssetUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AssetUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); + /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. @@ -149,8 +149,8 @@ public override string ToString() } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(AssetUpdateTagsTypeConverter))] + public partial interface IAssetUpdateTags { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.TypeConverter.cs index 9379b445cec..063a9666774 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class AssetUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return AssetUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Con } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return AssetUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return AssetUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.cs similarity index 73% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.cs index 107aec646ac..730d67ba2a1 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITagsInternal + public partial class AssetUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public AssetUpdateTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface IAssetUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface IAssetUpdateTagsInternal { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.dictionary.cs index 44ca6f196ab..fd2effce85e 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models { using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; - public partial class Tags : + public partial class AssetUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.AssetUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.json.cs new file mode 100644 index 00000000000..c511b674fdf --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/AssetUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// Resource tags. + public partial class AssetUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AssetUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new AssetUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 35490b4333c..178b6e676bc 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs index 1310e3bf582..e9fd8aefaf0 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs @@ -143,14 +143,6 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -163,6 +155,14 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -216,14 +216,6 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -236,6 +228,14 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 6f07adedd7d..9d23b1f4c2c 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.cs index 5043a91ae66..f91b39b43a2 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Origin(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.json.cs index b9b9f3af906..9ca65ce7ec9 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runti return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.PowerShell.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 81% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.PowerShell.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 07384f00ade..79112576b5c 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models { using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; - /// A set of key-value pairs that contain custom attributes set by the customer. - [System.ComponentModel.TypeConverter(typeof(AttributesTypeConverter))] - public partial class Attributes + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,75 +61,37 @@ public partial class Attributes partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Attributes(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Attributes(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Attributes(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Attributes(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -147,10 +109,48 @@ public override string ToString() } return ToJsonString(); } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } } - /// A set of key-value pairs that contain custom attributes set by the customer. - [System.ComponentModel.TypeConverter(typeof(AttributesTypeConverter))] - public partial interface IAttributes + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.TypeConverter.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.TypeConverter.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 6caf0c1a3b2..1733ae10cac 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Attributes.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class AttributesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class AttributesTypeConverter : global::System.Management.Automat public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Attributes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttribut } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Attributes.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Attributes.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 00000000000..61e85f93a69 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 00000000000..a933f365fa4 --- /dev/null +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 86% rename from tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 6863307e75b..97fed78ecd2 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models using static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonNode T AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs index 7f6b963a413..f6bbe3372ad 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded.cs @@ -264,8 +264,8 @@ public partial class NewAzDeviceRegistryAssetEndpointProfile_CreateExpanded : gl ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaIdentityExpanded.cs index 7812e9449ca..dc05a85aa53 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAssetEndpointProfile_CreateViaIdentityExpanded.cs @@ -224,8 +224,8 @@ public partial class NewAzDeviceRegistryAssetEndpointProfile_CreateViaIdentityEx ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs index fcf7adddcb3..00fc91dac65 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateExpanded.cs @@ -69,8 +69,8 @@ public partial class NewAzDeviceRegistryAsset_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -466,8 +466,8 @@ public partial class NewAzDeviceRegistryAsset_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaIdentityExpanded.cs index 674adecd71f..c552114a92c 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/NewAzDeviceRegistryAsset_CreateViaIdentityExpanded.cs @@ -69,8 +69,8 @@ public partial class NewAzDeviceRegistryAsset_CreateViaIdentityExpanded : global ReadOnly = false, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -426,8 +426,8 @@ public partial class NewAzDeviceRegistryAsset_CreateViaIdentityExpanded : global ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAssetEndpointProfile_ReplaceExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAssetEndpointProfile_ReplaceExpanded.cs index 0ee4595bedc..a4f912bdb73 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAssetEndpointProfile_ReplaceExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAssetEndpointProfile_ReplaceExpanded.cs @@ -265,8 +265,8 @@ public partial class SetAzDeviceRegistryAssetEndpointProfile_ReplaceExpanded : g ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAsset_ReplaceExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAsset_ReplaceExpanded.cs index c59b0dc7ad6..f8cb7d6c010 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAsset_ReplaceExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/SetAzDeviceRegistryAsset_ReplaceExpanded.cs @@ -70,8 +70,8 @@ public partial class SetAzDeviceRegistryAsset_ReplaceExpanded : global::System.M ReadOnly = false, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetPropertiesAttributes Attribute { get => _resourceBody.Attribute ?? null /* object */; set => _resourceBody.Attribute = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -467,8 +467,8 @@ public partial class SetAzDeviceRegistryAsset_ReplaceExpanded : global::System.M ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs index 7414354abad..6906bcbd284 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded.cs @@ -217,8 +217,8 @@ public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs index 27ac7dc93b3..c7d3a960730 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentityExpanded.cs @@ -177,8 +177,8 @@ public partial class UpdateAzDeviceRegistryAssetEndpointProfile_UpdateViaIdentit ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetEndpointProfileUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs index 07bb487c05e..edfeba760f8 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateExpanded.cs @@ -55,8 +55,8 @@ public partial class UpdateAzDeviceRegistryAsset_UpdateExpanded : global::System ReadOnly = false, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => _propertiesBody.Attribute ?? null /* object */; set => _propertiesBody.Attribute = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get => _propertiesBody.Attribute ?? null /* object */; set => _propertiesBody.Attribute = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -393,8 +393,8 @@ public partial class UpdateAzDeviceRegistryAsset_UpdateExpanded : global::System ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs index b29c86efc6f..be624cddf77 100644 --- a/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DeviceRegistry.Management/target/generated/cmdlets/UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded.cs @@ -55,8 +55,8 @@ public partial class UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"A set of key-value pairs that contain custom attributes set by the customer.", SerializedName = @"attributes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAttributes Attribute { get => _propertiesBody.Attribute ?? null /* object */; set => _propertiesBody.Attribute = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdatePropertiesAttributes Attribute { get => _propertiesBody.Attribute ?? null /* object */; set => _propertiesBody.Attribute = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -353,8 +353,8 @@ public partial class UpdateAzDeviceRegistryAsset_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DeviceRegistry.Models.IAssetUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 0e71c64d64e..eb1410460bd 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.PowerShell.cs index d7cbfd07b2d..e07e9dc4fbc 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.PowerShell.cs @@ -157,7 +157,7 @@ internal MongoCluster(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -171,10 +171,6 @@ internal MongoCluster(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("RestoreParameter")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).RestoreParameter = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterRestoreParameters) content.GetValueForProperty("RestoreParameter",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).RestoreParameter, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterRestoreParametersTypeConverter.ConvertFrom); @@ -235,6 +231,10 @@ internal MongoCluster(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("InfrastructureVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).InfrastructureVersion = (string) content.GetValueForProperty("InfrastructureVersion",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).InfrastructureVersion, global::System.Convert.ToString); @@ -366,7 +366,7 @@ internal MongoCluster(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -380,10 +380,6 @@ internal MongoCluster(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("RestoreParameter")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).RestoreParameter = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterRestoreParameters) content.GetValueForProperty("RestoreParameter",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).RestoreParameter, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterRestoreParametersTypeConverter.ConvertFrom); @@ -444,6 +440,10 @@ internal MongoCluster(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("InfrastructureVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).InfrastructureVersion = (string) content.GetValueForProperty("InfrastructureVersion",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterInternal)this).InfrastructureVersion, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.cs index 53c72e84396..aa95df37a7a 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoCluster.cs @@ -272,7 +272,7 @@ public partial class MongoCluster : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Origin(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.PowerShell.cs index 3bd24686b82..a71e8f3baad 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.PowerShell.cs @@ -113,11 +113,7 @@ internal MongoClusterUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Administrator")) { @@ -155,6 +151,10 @@ internal MongoClusterUpdate(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("StorageSizeGb")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).StorageSizeGb = (long?) content.GetValueForProperty("StorageSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).StorageSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -210,11 +210,7 @@ internal MongoClusterUpdate(global::System.Management.Automation.PSObject conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Administrator")) { @@ -252,6 +248,10 @@ internal MongoClusterUpdate(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("StorageSizeGb")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).StorageSizeGb = (long?) content.GetValueForProperty("StorageSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateInternal)this).StorageSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.cs index fc6321e7fb4..fa4900c2cb9 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.cs @@ -95,11 +95,11 @@ public partial class MongoClusterUpdate : public long? StorageSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdatePropertiesInternal)Property).StorageSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdatePropertiesInternal)Property).StorageSizeGb = value ?? default(long); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Origin(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateTags()); set => this._tag = value; } /// Creates an new instance. public MongoClusterUpdate() @@ -250,8 +250,8 @@ public partial interface IMongoClusterUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags Tag { get; set; } } /// The type used for update operations of the MongoCluster. @@ -306,7 +306,7 @@ internal partial interface IMongoClusterUpdateInternal /// The size of the data disk assigned to each server. long? StorageSizeGb { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.json.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.json.cs index 98f53ac7420..264804c9967 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.json.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdate.json.cs @@ -76,7 +76,7 @@ internal MongoClusterUpdate(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runt return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.PowerShell.cs similarity index 77% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.PowerShell.cs index 3b0277e0ded..61f247d8de6 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.PowerShell.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models { - using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(MongoClusterUpdateTagsTypeConverter))] + public partial class MongoClusterUpdateTags { /// @@ -61,61 +61,44 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new MongoClusterUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new MongoClusterUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal MongoClusterUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +113,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal MongoClusterUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +130,27 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(MongoClusterUpdateTagsTypeConverter))] + public partial interface IMongoClusterUpdateTags { diff --git a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.TypeConverter.cs similarity index 82% rename from tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.TypeConverter.cs index 0e502354645..89dc6f45369 100644 --- a/tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.TypeConverter.cs @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models { - using Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class MongoClusterUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -63,7 +63,7 @@ public static bool CanConvertFrom(dynamic sourceValue) try { string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonType.Object; + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonType.Object; } catch { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return MongoClusterUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IUserAssign } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return MongoClusterUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return MongoClusterUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.cs new file mode 100644 index 00000000000..f9ee2f88aa3 --- /dev/null +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; + + /// Resource tags. + public partial class MongoClusterUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTagsInternal + { + + /// Creates an new instance. + public MongoClusterUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IMongoClusterUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IMongoClusterUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.dictionary.cs new file mode 100644 index 00000000000..59bb501cda7 --- /dev/null +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; + + public partial class MongoClusterUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.json.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.json.cs new file mode 100644 index 00000000000..9f5417ba490 --- /dev/null +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/MongoClusterUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; + + /// Resource tags. + public partial class MongoClusterUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json ? new MongoClusterUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject instance to deserialize from. + /// + internal MongoClusterUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs index f56abca9e48..f2ae7a6cc0b 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs @@ -155,14 +155,14 @@ internal PrivateEndpointConnection(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -248,14 +248,14 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs index 71df0b5da95..c6d53b2a079 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs @@ -159,14 +159,14 @@ internal PrivateEndpointConnectionResource(global::System.Collections.IDictionar { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -252,14 +252,14 @@ internal PrivateEndpointConnectionResource(global::System.Management.Automation. { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Replica.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Replica.PowerShell.cs index 0eb68f37f63..764d08f6953 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Replica.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Replica.PowerShell.cs @@ -159,10 +159,6 @@ internal Replica(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("RestoreParameter")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).RestoreParameter = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterRestoreParameters) content.GetValueForProperty("RestoreParameter",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).RestoreParameter, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterRestoreParametersTypeConverter.ConvertFrom); @@ -223,6 +219,10 @@ internal Replica(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("InfrastructureVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).InfrastructureVersion = (string) content.GetValueForProperty("InfrastructureVersion",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).InfrastructureVersion, global::System.Convert.ToString); @@ -356,10 +356,6 @@ internal Replica(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("PreviewFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("RestoreParameter")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).RestoreParameter = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterRestoreParameters) content.GetValueForProperty("RestoreParameter",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).RestoreParameter, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.MongoClusterRestoreParametersTypeConverter.ConvertFrom); @@ -420,6 +416,10 @@ internal Replica(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } + if (content.Contains("PreviewFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature = (System.Collections.Generic.List) content.GetValueForProperty("PreviewFeature",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).PreviewFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("InfrastructureVersion")) { ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).InfrastructureVersion = (string) content.GetValueForProperty("InfrastructureVersion",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IReplicaInternal)this).InfrastructureVersion, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 93597e64797..e46881c5692 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.cs index 56b72f0da79..d293362b10e 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Origin(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.json.cs index 3967429c67a..18e96ef1b36 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index f351d33735b..1f79922d7b3 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models using Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index b8cab0bb026..6512e7802a6 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models using Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Conve } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.cs index 16de5074d15..4d4cc98e2a9 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index b95a7ccda9d..6b8cd104141 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 78c39ee75d6..731a721662c 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models using static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode ToJ AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateExpanded.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateExpanded.cs index f23ea60908d..65c10f9abee 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateExpanded.cs @@ -369,8 +369,8 @@ public partial class NewAzMongoCluster_CreateExpanded : global::System.Managemen ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateViaIdentityExpanded.cs index e08f25aa613..6d90f4923fc 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/NewAzMongoCluster_CreateViaIdentityExpanded.cs @@ -329,8 +329,8 @@ public partial class NewAzMongoCluster_CreateViaIdentityExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/SetAzMongoCluster_UpdateExpanded.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/SetAzMongoCluster_UpdateExpanded.cs index 67cf30a3d5e..84a98f6bf77 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/SetAzMongoCluster_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/SetAzMongoCluster_UpdateExpanded.cs @@ -370,8 +370,8 @@ public partial class SetAzMongoCluster_UpdateExpanded : global::System.Managemen ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateExpanded.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateExpanded.cs index 8912a151c69..64c8d2e7161 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateExpanded.cs @@ -302,8 +302,8 @@ public partial class UpdateAzMongoCluster_UpdateExpanded : global::System.Manage ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateViaIdentityExpanded.cs index 6556e718e43..aebde8d2b29 100644 --- a/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/cmdlets/UpdateAzMongoCluster_UpdateViaIdentityExpanded.cs @@ -262,8 +262,8 @@ public partial class UpdateAzMongoCluster_UpdateViaIdentityExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Models.IMongoClusterUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/EdgeZones.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/EdgeZones.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 4f86780cc14..e30144dd7a8 100644 --- a/tests-upgrade/tests-emitter/EdgeZones.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/EdgeZones.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.EdgeZones.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.PowerShell.cs index 8c016a8a7ad..1a8116c2908 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.PowerShell.cs @@ -132,7 +132,7 @@ internal DeidService(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -168,7 +168,7 @@ internal DeidService(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -245,7 +245,7 @@ internal DeidService(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -281,7 +281,7 @@ internal DeidService(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidServiceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.cs index 874d06cbde5..947bf40b61f 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidService.cs @@ -55,7 +55,7 @@ public partial class DeidService : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Inherited)] @@ -181,7 +181,7 @@ public partial class DeidService : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -282,8 +282,8 @@ public partial interface IDeidService : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// List of private endpoint connections. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Info( Required = false, @@ -362,7 +362,7 @@ internal partial interface IDeidServiceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// List of private endpoint connections. System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// The resource-specific properties for this resource. diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.PowerShell.cs index ae2cb3b11de..03bff2c95f3 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.PowerShell.cs @@ -84,7 +84,7 @@ internal DeidUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { @@ -92,7 +92,7 @@ internal DeidUpdate(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PublicNetworkAccess")) { @@ -125,7 +125,7 @@ internal DeidUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { @@ -133,7 +133,7 @@ internal DeidUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("PublicNetworkAccess")) { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.cs index e2b52861f6a..cdcb7be95d2 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.cs @@ -24,7 +24,7 @@ public partial class DeidUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdate Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdate()); set { {_identity = value;} } } @@ -44,11 +44,11 @@ public partial class DeidUpdate : public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidPropertiesUpdateInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidPropertiesUpdateInternal)Property).PublicNetworkAccess = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidUpdateTags()); set => this._tag = value; } /// Creates an new instance. public DeidUpdate() @@ -81,8 +81,8 @@ public partial interface IDeidUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Gets or sets allow or disallow public network access to resource [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Info( Required = false, @@ -104,8 +104,8 @@ public partial interface IDeidUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags Tag { get; set; } } /// Patch request body for DeidService @@ -118,14 +118,14 @@ internal partial interface IDeidUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// RP-specific properties Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidPropertiesUpdate Property { get; set; } /// Gets or sets allow or disallow public network access to resource [global::Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PSArgumentCompleterAttribute("Enabled", "Disabled")] string PublicNetworkAccess { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.json.cs index 2de35dd1a04..c679df22295 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdate.json.cs @@ -65,7 +65,7 @@ internal DeidUpdate(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runt } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdate.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidPropertiesUpdate.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.PowerShell.cs index 1440d1c7d0d..f1239c7e9af 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(DeidUpdateTagsTypeConverter))] + public partial class DeidUpdateTags { /// @@ -61,44 +61,11 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Tags(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Tags(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal DeidUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +80,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal DeidUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -131,6 +98,39 @@ internal Tags(global::System.Management.Automation.PSObject content) AfterDeserializePSObject(content); } + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeidUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeidUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); + /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. @@ -149,8 +149,8 @@ public override string ToString() } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(DeidUpdateTagsTypeConverter))] + public partial interface IDeidUpdateTags { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.TypeConverter.cs index b49a9d2718c..249e882e3e8 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class DeidUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return DeidUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITa } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return DeidUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return DeidUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.cs similarity index 73% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.cs index 270c2139f93..63686d6e3b1 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITagsInternal + public partial class DeidUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public DeidUpdateTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface IDeidUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface IDeidUpdateTagsInternal { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.dictionary.cs index 58ee9cffe16..27eb037bb58 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; - public partial class Tags : + public partial class DeidUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.DeidUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.json.cs index 2f19642c8df..9a0e9cd25ee 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/DeidUpdateTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class DeidUpdateTags { /// @@ -52,23 +52,11 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject instance to deserialize from. /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal DeidUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -81,13 +69,25 @@ internal Tags(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Js } /// - /// Serializes this instance of into a . + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IDeidUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new DeidUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 997d736fff2..ff5dcb9b371 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index e5782778144..a244d328d32 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 50b7ae699a3..8ad66110ba4 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index 90c266feb22..47ee3f28735 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIS {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs index c53377a8565..761765b0ed1 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.PowerShell.cs @@ -115,7 +115,7 @@ internal ManagedServiceIdentityUpdate(global::System.Collections.IDictionary con } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -140,7 +140,7 @@ internal ManagedServiceIdentityUpdate(global::System.Management.Automation.PSObj } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs index db8b7c762c6..7412a74736b 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.cs @@ -19,11 +19,11 @@ public partial class ManagedServiceIdentityUpdate : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentityUpdate() @@ -56,8 +56,8 @@ public partial interface IManagedServiceIdentityUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get; set; } } /// The template for adding optional properties. @@ -68,7 +68,7 @@ internal partial interface IManagedServiceIdentityUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs index f5a006dd2f2..d6745b4dd1e 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdate.json.cs @@ -76,7 +76,7 @@ internal ManagedServiceIdentityUpdate(Microsoft.Azure.PowerShell.Cmdlets.HealthD return; } {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..a0fc5007dee --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUpdateUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUpdateUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUpdateUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUpdateUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUpdateUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..bd6cb4cad89 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUpdateUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a + /// type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUpdateUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs new file mode 100644 index 00000000000..1cecd23ab50 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + /// The identities assigned to this resource by the user. + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentitiesInternal + { + + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUpdateUserAssignedIdentities() + { + + } + } + /// The identities assigned to this resource by the user. + public partial interface IManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray + { + + } + /// The identities assigned to this resource by the user. + internal partial interface IManagedServiceIdentityUpdateUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs new file mode 100644 index 00000000000..09c2327bec0 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUpdateUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs new file mode 100644 index 00000000000..ac400003394 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUpdateUserAssignedIdentities.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + /// The identities assigned to this resource by the user. + public partial class ManagedServiceIdentityUpdateUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUpdateUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUpdateUserAssignedIdentities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUpdateUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..00ef02ed14a --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..f5082ebe672 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 1f05c9936a2..3ce79cd7bc6 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 97% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index d0499faa13c..bfedf969324 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models { using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index 2537a5ac557..254d0d95881 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.Json AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs index a71b9db5be6..a78647bc352 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnection.PowerShell.cs @@ -155,14 +155,14 @@ internal PrivateEndpointConnection(global::System.Collections.IDictionary conten { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -248,14 +248,14 @@ internal PrivateEndpointConnection(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs index 76d7f32e3a3..6ee67f9f681 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/PrivateEndpointConnectionResource.PowerShell.cs @@ -167,14 +167,14 @@ internal PrivateEndpointConnectionResource(global::System.Collections.IDictionar { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -268,14 +268,14 @@ internal PrivateEndpointConnectionResource(global::System.Management.Automation. { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateEndpointTypeConverter.ConvertFrom); } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("PrivateLinkServiceConnectionState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IPrivateEndpointConnectionResourceInternal)this).ProvisioningState, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 429ed899018..7c6a4b38381 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.cs index 0bdad919256..59f6ea36480 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.cs @@ -97,11 +97,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Origin(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -152,8 +152,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -163,7 +163,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.json.cs index d7ab216aed9..e8cf3c8e320 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 9b2b91b7fe8..4cb21557a3a 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models { using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,37 +61,37 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -111,11 +111,11 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +130,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -148,9 +148,9 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co AfterDeserializePSObject(content); } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index a68ea4d93d6..67563fff22f 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models using Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.IUs } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 00000000000..4b595e3e1a9 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 00000000000..2e1938300f9 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.json.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.json.cs new file mode 100644 index 00000000000..208f75ec2b5 --- /dev/null +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateExpanded.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateExpanded.cs index 33c4e5d0694..65b2cf1bf79 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateExpanded.cs @@ -206,8 +206,8 @@ public partial class NewAzHealthDataAiServicesDeidService_CreateExpanded : globa ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateViaIdentityExpanded.cs index 2f3dd4c7df7..1f1eed46173 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/NewAzHealthDataAiServicesDeidService_CreateViaIdentityExpanded.cs @@ -166,8 +166,8 @@ public partial class NewAzHealthDataAiServicesDeidService_CreateViaIdentityExpan ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateExpanded.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateExpanded.cs index f55d72c45d6..ab3efd3e175 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateExpanded.cs @@ -195,8 +195,8 @@ public partial class UpdateAzHealthDataAiServicesDeidService_UpdateExpanded : gl ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -557,7 +557,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) { diff --git a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateViaIdentityExpanded.cs index 561a84265c9..8ab4779f824 100644 --- a/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/HealthDataAIServices.Management/target/generated/cmdlets/UpdateAzHealthDataAiServicesDeidService_UpdateViaIdentityExpanded.cs @@ -155,8 +155,8 @@ public partial class UpdateAzHealthDataAiServicesDeidService_UpdateViaIdentityEx ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -540,7 +540,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.HealthDataAIServices.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PublicNetworkAccess"))) { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 0f4940f5c60..697b6a6e9f3 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.PowerShell.cs index 5f7b86559e4..7f21935f78f 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.PowerShell.cs @@ -157,7 +157,7 @@ internal InformaticaOrganizationResource(global::System.Collections.IDictionary } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -350,7 +350,7 @@ internal InformaticaOrganizationResource(global::System.Management.Automation.PS } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.cs index f237e6320c9..2b71d0bfa7e 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResource.cs @@ -211,7 +211,7 @@ public partial class InformaticaOrganizationResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Informatica.Origin(Microsoft.Azure.PowerShell.Cmdlets.Informatica.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.PowerShell.cs index 8a33280a50d..25d42702d55 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.PowerShell.cs @@ -114,7 +114,7 @@ internal InformaticaOrganizationResourceUpdate(global::System.Collections.IDicti // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.InformaticaOrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { @@ -139,7 +139,7 @@ internal InformaticaOrganizationResourceUpdate(global::System.Management.Automat // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.InformaticaOrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("Property")) { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.cs index d5a108322d2..58f245fb660 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.cs @@ -21,11 +21,11 @@ public partial class InformaticaOrganizationResourceUpdate : public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IOrganizationPropertiesCustomUpdate Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.OrganizationPropertiesCustomUpdate()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Informatica.Origin(Microsoft.Azure.PowerShell.Cmdlets.Informatica.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.InformaticaOrganizationResourceUpdateTags()); set => this._tag = value; } /// Creates an new instance. public InformaticaOrganizationResourceUpdate() @@ -59,8 +59,8 @@ public partial interface IInformaticaOrganizationResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags Tag { get; set; } } /// The template for adding optional properties. @@ -72,7 +72,7 @@ internal partial interface IInformaticaOrganizationResourceUpdateInternal /// Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IOrganizationPropertiesCustomUpdate Property { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.json.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.json.cs index b24356401a6..500326d270d 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdate.json.cs @@ -75,7 +75,7 @@ internal InformaticaOrganizationResourceUpdate(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.InformaticaOrganizationResourceUpdateTags.FromJson(__jsonTags) : _tag;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.OrganizationPropertiesCustomUpdate.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.PowerShell.cs new file mode 100644 index 00000000000..1167b0b0105 --- /dev/null +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(InformaticaOrganizationResourceUpdateTagsTypeConverter))] + public partial class InformaticaOrganizationResourceUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InformaticaOrganizationResourceUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InformaticaOrganizationResourceUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InformaticaOrganizationResourceUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InformaticaOrganizationResourceUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(InformaticaOrganizationResourceUpdateTagsTypeConverter))] + public partial interface IInformaticaOrganizationResourceUpdateTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.TypeConverter.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.TypeConverter.cs new file mode 100644 index 00000000000..f8eb0a9bcc0 --- /dev/null +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InformaticaOrganizationResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InformaticaOrganizationResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InformaticaOrganizationResourceUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InformaticaOrganizationResourceUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.cs new file mode 100644 index 00000000000..522cf6c7dca --- /dev/null +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; + + /// Resource tags. + public partial class InformaticaOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTagsInternal + { + + /// + /// Creates an new instance. + /// + public InformaticaOrganizationResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IInformaticaOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IInformaticaOrganizationResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..65ac6e0fcff --- /dev/null +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; + + public partial class InformaticaOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.InformaticaOrganizationResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.json.cs new file mode 100644 index 00000000000..42ef04b8d66 --- /dev/null +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/InformaticaOrganizationResourceUpdateTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; + + /// Resource tags. + public partial class InformaticaOrganizationResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json ? new InformaticaOrganizationResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject instance to deserialize from. + /// + internal InformaticaOrganizationResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 7269879e242..37543161a13 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.cs index 4999c0ca51a..6c4fdeaaebf 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Informatica.Origin(Microsoft.Azure.PowerShell.Cmdlets.Informatica.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.json.cs index aeeb9c4de58..1090fd1c11e 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime. return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 2b191b686fc..7dddf562786 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models using Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 2349e3001e2..55080c6f4a3 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models using Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Conver } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.cs index ecb9a9571ed..a45f0868855 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 04efbc3a730..a8fdd07c1b6 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 28d427e570e..99d9eee9cf0 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models using static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonNode ToJs AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Informatica.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateExpanded.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateExpanded.cs index 840b4f24ac2..91b51daef9a 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateExpanded.cs @@ -388,8 +388,8 @@ public partial class NewAzInformaticaOrganization_CreateExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// User email address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User email address.")] diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateViaIdentityExpanded.cs index 58859cb9243..1ea94a26df7 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/NewAzInformaticaOrganization_CreateViaIdentityExpanded.cs @@ -348,8 +348,8 @@ public partial class NewAzInformaticaOrganization_CreateViaIdentityExpanded : gl ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// User email address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User email address.")] diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/SetAzInformaticaOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/SetAzInformaticaOrganization_UpdateExpanded.cs index 47f26094e2f..104a10da0a2 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/SetAzInformaticaOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/SetAzInformaticaOrganization_UpdateExpanded.cs @@ -389,8 +389,8 @@ public partial class SetAzInformaticaOrganization_UpdateExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// User email address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User email address.")] diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateExpanded.cs index a9bc85c9cda..7ca261cf353 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateExpanded.cs @@ -188,8 +188,8 @@ public partial class UpdateAzInformaticaOrganization_UpdateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateViaIdentityExpanded.cs index 628be262018..66687cbe35a 100644 --- a/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Informatica.DataManagement.Management/target/generated/cmdlets/UpdateAzInformaticaOrganization_UpdateViaIdentityExpanded.cs @@ -148,8 +148,8 @@ public partial class UpdateAzInformaticaOrganization_UpdateViaIdentityExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Informatica.Models.IInformaticaOrganizationResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 68c0a6d0a2a..d54a58cb02d 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.PowerShell.cs index 57fa0622b07..6aba5783026 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.PowerShell.cs @@ -157,10 +157,6 @@ internal LoadBalancer(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("ServiceSelector")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelectorTypeConverter.ConvertFrom); - } if (content.Contains("AdvertiseMode")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).AdvertiseMode = (string) content.GetValueForProperty("AdvertiseMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).AdvertiseMode, global::System.Convert.ToString); @@ -173,6 +169,10 @@ internal LoadBalancer(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).Address = (System.Collections.Generic.List) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).Address, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("ServiceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelectorTypeConverter.ConvertFrom); + } if (content.Contains("BgpPeer")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).BgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -242,10 +242,6 @@ internal LoadBalancer(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("ServiceSelector")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelectorTypeConverter.ConvertFrom); - } if (content.Contains("AdvertiseMode")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).AdvertiseMode = (string) content.GetValueForProperty("AdvertiseMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).AdvertiseMode, global::System.Convert.ToString); @@ -258,6 +254,10 @@ internal LoadBalancer(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).Address = (System.Collections.Generic.List) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).Address, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } + if (content.Contains("ServiceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelectorTypeConverter.ConvertFrom); + } if (content.Contains("BgpPeer")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).BgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.cs index b3339e4f388..aff1c96b617 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancer.cs @@ -106,7 +106,7 @@ public partial class LoadBalancer : /// with label "a=b", then please specify {"a": "b"} in the field. /// [Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)Property).ServiceSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)Property).ServiceSelector = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)Property).ServiceSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)Property).ServiceSelector = value ?? null /* model class */; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -247,8 +247,8 @@ public partial interface ILoadBalancer : Update = true, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get; set; } } /// A LoadBalancer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) @@ -275,7 +275,7 @@ internal partial interface ILoadBalancerInternal : /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.PowerShell.cs index 7b58cf06f10..45b5b28193e 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.PowerShell.cs @@ -115,7 +115,7 @@ internal LoadBalancerProperties(global::System.Collections.IDictionary content) } if (content.Contains("ServiceSelector")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelectorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelectorTypeConverter.ConvertFrom); } if (content.Contains("AdvertiseMode")) { @@ -152,7 +152,7 @@ internal LoadBalancerProperties(global::System.Management.Automation.PSObject co } if (content.Contains("ServiceSelector")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelectorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) content.GetValueForProperty("ServiceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesInternal)this).ServiceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelectorTypeConverter.ConvertFrom); } if (content.Contains("AdvertiseMode")) { diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.cs index 44959330c21..265a75cddae 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.cs @@ -45,14 +45,14 @@ public partial class LoadBalancerProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector _serviceSelector; + private Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector _serviceSelector; /// /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// [Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => (this._serviceSelector = this._serviceSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelector()); set => this._serviceSelector = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => (this._serviceSelector = this._serviceSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelector()); set => this._serviceSelector = value; } /// Creates an new instance. public LoadBalancerProperties() @@ -124,8 +124,8 @@ public partial interface ILoadBalancerProperties : Update = true, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get; set; } } /// Details of the LoadBalancer. @@ -148,7 +148,7 @@ internal partial interface ILoadBalancerPropertiesInternal /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.json.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.json.cs index 5ddf1713f21..18e47bafe9a 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.json.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerProperties.json.cs @@ -76,7 +76,7 @@ internal LoadBalancerProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrch return; } {_address = If( json?.PropertyT("addresses"), out var __jsonAddresses) ? If( __jsonAddresses as Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _address;} - {_serviceSelector = If( json?.PropertyT("serviceSelector"), out var __jsonServiceSelector) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelector.FromJson(__jsonServiceSelector) : _serviceSelector;} + {_serviceSelector = If( json?.PropertyT("serviceSelector"), out var __jsonServiceSelector) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelector.FromJson(__jsonServiceSelector) : _serviceSelector;} {_advertiseMode = If( json?.PropertyT("advertiseMode"), out var __jsonAdvertiseMode) ? (string)__jsonAdvertiseMode : (string)_advertiseMode;} {_bgpPeer = If( json?.PropertyT("bgpPeers"), out var __jsonBgpPeers) ? If( __jsonBgpPeers as Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _bgpPeer;} {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.PowerShell.cs similarity index 78% rename from tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.PowerShell.cs rename to tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.PowerShell.cs index 1286f875618..c0d2bfea281 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.PowerShell.cs @@ -9,8 +9,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// - [System.ComponentModel.TypeConverter(typeof(ServiceSelectorTypeConverter))] - public partial class ServiceSelector + [System.ComponentModel.TypeConverter(typeof(LoadBalancerPropertiesServiceSelectorTypeConverter))] + public partial class LoadBalancerPropertiesServiceSelector { /// @@ -64,44 +64,49 @@ public partial class ServiceSelector partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new ServiceSelector(content); + return new LoadBalancerPropertiesServiceSelector(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new ServiceSelector(content); + return new LoadBalancerPropertiesServiceSelector(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json + /// string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal ServiceSelector(global::System.Collections.IDictionary content) + internal LoadBalancerPropertiesServiceSelector(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -116,11 +121,11 @@ internal ServiceSelector(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal ServiceSelector(global::System.Management.Automation.PSObject content) + internal LoadBalancerPropertiesServiceSelector(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -153,8 +158,8 @@ public override string ToString() } /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. - [System.ComponentModel.TypeConverter(typeof(ServiceSelectorTypeConverter))] - public partial interface IServiceSelector + [System.ComponentModel.TypeConverter(typeof(LoadBalancerPropertiesServiceSelectorTypeConverter))] + public partial interface ILoadBalancerPropertiesServiceSelector { diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.TypeConverter.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.TypeConverter.cs similarity index 81% rename from tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.TypeConverter.cs rename to tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.TypeConverter.cs index 649bbe2c4f0..568a22cf873 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.TypeConverter.cs @@ -6,9 +6,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models using Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class ServiceSelectorTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class LoadBalancerPropertiesServiceSelectorTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +25,14 @@ public partial class ServiceSelectorTypeConverter : global::System.Management.Au public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise + /// false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +95,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector).IsAssignableFrom(type)) { return sourceValue; } try { - return ServiceSelector.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return LoadBalancerPropertiesServiceSelector.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +128,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Mo } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return ServiceSelector.DeserializeFromPSObject(sourceValue); + return LoadBalancerPropertiesServiceSelector.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return ServiceSelector.DeserializeFromDictionary(sourceValue); + return LoadBalancerPropertiesServiceSelector.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.cs similarity index 74% rename from tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.cs rename to tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.cs index 4a54d862679..411a2349d89 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.cs @@ -9,20 +9,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// - public partial class ServiceSelector : - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector, - Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelectorInternal + public partial class LoadBalancerPropertiesServiceSelector : + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector, + Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelectorInternal { - /// Creates an new instance. - public ServiceSelector() + /// Creates an new instance. + public LoadBalancerPropertiesServiceSelector() { } } /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. - public partial interface IServiceSelector : + public partial interface ILoadBalancerPropertiesServiceSelector : Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.IAssociativeArray { @@ -30,7 +30,7 @@ public partial interface IServiceSelector : } /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. - internal partial interface IServiceSelectorInternal + internal partial interface ILoadBalancerPropertiesServiceSelectorInternal { diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.dictionary.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.dictionary.cs rename to tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.dictionary.cs index 342c8ca3cfb..273f9157c4a 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.dictionary.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Extensions; - public partial class ServiceSelector : + public partial class LoadBalancerPropertiesServiceSelector : Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ServiceSelector source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.LoadBalancerPropertiesServiceSelector source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.json.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.json.cs rename to tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.json.cs index 67c192e2578..7721e618745 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/ServiceSelector.json.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/LoadBalancerPropertiesServiceSelector.json.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models /// A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services /// with label "a=b", then please specify {"a": "b"} in the field. /// - public partial class ServiceSelector + public partial class LoadBalancerPropertiesServiceSelector { /// @@ -55,23 +55,23 @@ public partial class ServiceSelector partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject json ? new ServiceSelector(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject json ? new LoadBalancerPropertiesServiceSelector(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject instance to deserialize from. /// - internal ServiceSelector(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal LoadBalancerPropertiesServiceSelector(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -84,13 +84,14 @@ internal ServiceSelector(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestrato } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResource.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResource.PowerShell.cs index 3f8ea15ad14..7c6132391c2 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResource.PowerShell.cs @@ -159,14 +159,6 @@ internal StorageClassResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("MountOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("AccessMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("Priority")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Priority = (long?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Priority, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -183,6 +175,10 @@ internal StorageClassResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AllowVolumeExpansion = (string) content.GetValueForProperty("AllowVolumeExpansion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AllowVolumeExpansion, global::System.Convert.ToString); } + if (content.Contains("MountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("Provisioner")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Provisioner = (string) content.GetValueForProperty("Provisioner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Provisioner, global::System.Convert.ToString); @@ -191,6 +187,10 @@ internal StorageClassResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).VolumeBindingMode = (string) content.GetValueForProperty("VolumeBindingMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).VolumeBindingMode, global::System.Convert.ToString); } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("DataResilience")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).DataResilience = (string) content.GetValueForProperty("DataResilience",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).DataResilience, global::System.Convert.ToString); @@ -276,14 +276,6 @@ internal StorageClassResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("MountOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("AccessMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("Priority")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Priority = (long?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Priority, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -300,6 +292,10 @@ internal StorageClassResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AllowVolumeExpansion = (string) content.GetValueForProperty("AllowVolumeExpansion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AllowVolumeExpansion, global::System.Convert.ToString); } + if (content.Contains("MountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("Provisioner")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Provisioner = (string) content.GetValueForProperty("Provisioner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).Provisioner, global::System.Convert.ToString); @@ -308,6 +304,10 @@ internal StorageClassResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).VolumeBindingMode = (string) content.GetValueForProperty("VolumeBindingMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).VolumeBindingMode, global::System.Convert.ToString); } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("DataResilience")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).DataResilience = (string) content.GetValueForProperty("DataResilience",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceInternal)this).DataResilience, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResourceUpdate.PowerShell.cs index abf5296602b..96b47186668 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/api/Models/StorageClassResourceUpdate.PowerShell.cs @@ -113,14 +113,6 @@ internal StorageClassResourceUpdate(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassPropertiesUpdate) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdateTypeConverter.ConvertFrom); } - if (content.Contains("MountOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("AccessMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("Priority")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Priority = (long?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Priority, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -133,6 +125,14 @@ internal StorageClassResourceUpdate(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AllowVolumeExpansion = (string) content.GetValueForProperty("AllowVolumeExpansion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AllowVolumeExpansion, global::System.Convert.ToString); } + if (content.Contains("MountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("DataResilience")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).DataResilience = (string) content.GetValueForProperty("DataResilience",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).DataResilience, global::System.Convert.ToString); @@ -218,14 +218,6 @@ internal StorageClassResourceUpdate(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassPropertiesUpdate) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.StorageClassPropertiesUpdateTypeConverter.ConvertFrom); } - if (content.Contains("MountOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("AccessMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("Priority")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Priority = (long?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).Priority, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); @@ -238,6 +230,14 @@ internal StorageClassResourceUpdate(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AllowVolumeExpansion = (string) content.GetValueForProperty("AllowVolumeExpansion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AllowVolumeExpansion, global::System.Convert.ToString); } + if (content.Contains("MountOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption = (System.Collections.Generic.List) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).MountOption, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AccessMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode = (System.Collections.Generic.List) content.GetValueForProperty("AccessMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).AccessMode, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("DataResilience")) { ((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).DataResilience = (string) content.GetValueForProperty("DataResilience",((Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IStorageClassResourceUpdateInternal)this).DataResilience, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateExpanded.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateExpanded.cs index f03c10bc73e..ee3bdb7959c 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateExpanded.cs @@ -203,8 +203,8 @@ public partial class NewAzContainerOrchestratorRuntimeLoadBalancer_CreateExpande ReadOnly = false, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateViaIdentityExpanded.cs index 8bbd560302d..8e10e7e6bd5 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/NewAzContainerOrchestratorRuntimeLoadBalancer_CreateViaIdentityExpanded.cs @@ -182,8 +182,8 @@ public partial class NewAzContainerOrchestratorRuntimeLoadBalancer_CreateViaIden ReadOnly = false, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/SetAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/SetAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs index 95d96184a50..ea2d727e4a9 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/SetAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/SetAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs @@ -204,8 +204,8 @@ public partial class SetAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpande ReadOnly = false, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs index 54fc5794ef9..2f02c4fc8b2 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded.cs @@ -203,8 +203,8 @@ public partial class UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpa ReadOnly = false, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what @@ -518,10 +518,6 @@ public UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateExpanded() private void Update_resourceBody() { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceSelector"))) - { - this.ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector)(this.MyInvocation?.BoundParameters["ServiceSelector"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AdvertiseMode"))) { this.AdvertiseMode = (string)(this.MyInvocation?.BoundParameters["AdvertiseMode"]); @@ -530,6 +526,10 @@ private void Update_resourceBody() { this.Address = (string[])(this.MyInvocation?.BoundParameters["Address"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceSelector"))) + { + this.ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector)(this.MyInvocation?.BoundParameters["ServiceSelector"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("BgpPeer"))) { this.BgpPeer = (string[])(this.MyInvocation?.BoundParameters["BgpPeer"]); diff --git a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaIdentityExpanded.cs index a5b986957a0..5ac31f08f01 100644 --- a/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/KubernetesRuntime.Management/target/generated/cmdlets/UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaIdentityExpanded.cs @@ -182,8 +182,8 @@ public partial class UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaI ReadOnly = false, Description = @"A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label ""a=b"", then please specify {""a"": ""b""} in the field.", SerializedName = @"serviceSelector", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector) })] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector ServiceSelector { get => _resourceBody.ServiceSelector ?? null /* object */; set => _resourceBody.ServiceSelector = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what @@ -513,10 +513,6 @@ public UpdateAzContainerOrchestratorRuntimeLoadBalancer_UpdateViaIdentityExpande private void Update_resourceBody() { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceSelector"))) - { - this.ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.IServiceSelector)(this.MyInvocation?.BoundParameters["ServiceSelector"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AdvertiseMode"))) { this.AdvertiseMode = (string)(this.MyInvocation?.BoundParameters["AdvertiseMode"]); @@ -525,6 +521,10 @@ private void Update_resourceBody() { this.Address = (string[])(this.MyInvocation?.BoundParameters["Address"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceSelector"))) + { + this.ServiceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerOrchestratorRuntime.Models.ILoadBalancerPropertiesServiceSelector)(this.MyInvocation?.BoundParameters["ServiceSelector"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("BgpPeer"))) { this.BgpPeer = (string[])(this.MyInvocation?.BoundParameters["BgpPeer"]); diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 5c63624ba17..7fa595d06ee 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index 0e071d0dde2..7036240f758 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 743c60ea187..7efc46261b3 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index 5c74bc57303..bfb23c89e7a 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Ru {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..1da8b9bcacf --- /dev/null +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..cc887ee5585 --- /dev/null +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 57% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 1af16c4b67d..acad54e7912 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index f166b0eb844..8fe5c4197cb 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models { using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index f17d2523af9..be5800fcb5f 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode ToJso AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs index cae14eac7f3..206c7805bbf 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs @@ -147,10 +147,6 @@ internal OrganizationProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -183,6 +179,10 @@ internal OrganizationProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -264,10 +264,6 @@ internal OrganizationProperties(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -300,6 +296,10 @@ internal OrganizationProperties(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs index 2bee7f02655..8d409c518ff 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs @@ -167,7 +167,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -213,10 +213,6 @@ internal OrganizationResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -231,7 +227,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -265,6 +261,10 @@ internal OrganizationResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -364,7 +364,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -410,10 +410,6 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -428,7 +424,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -462,6 +458,10 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.cs index 00e5c83a413..c8193c3dafd 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResource.cs @@ -56,7 +56,7 @@ public partial class OrganizationResource : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Inherited)] @@ -238,7 +238,7 @@ public partial class OrganizationResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -359,8 +359,8 @@ public partial interface IOrganizationResource : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Info( Required = false, @@ -617,7 +617,7 @@ internal partial interface IOrganizationResourceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details of the resource. Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IMarketplaceDetails Marketplace { get; set; } /// Offer details for the marketplace that is selected by the user diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs index 24ab14ff80e..fbeb5d50b5e 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs @@ -113,7 +113,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -129,7 +129,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -170,7 +170,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.cs index 2489efd957a..07f9f23ffb7 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.cs @@ -36,7 +36,7 @@ public partial class OrganizationResourceUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentity()); set { {_identity = value;} } } @@ -48,11 +48,11 @@ public partial class OrganizationResourceUpdate : string Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.OrganizationResourceUpdateTags()); set => this._tag = value; } /// Creates an new instance. public OrganizationResourceUpdate() @@ -111,8 +111,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Info( Required = false, @@ -122,8 +122,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags Tag { get; set; } } /// The type used for update operations of the Organization Resource. @@ -144,9 +144,9 @@ internal partial interface IOrganizationResourceUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs index ed06d4a29f3..c654759d049 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs @@ -76,7 +76,7 @@ internal OrganizationResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.LambdaTes return; } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.OrganizationResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs index 26c610f42dc..9ce9c70af0c 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models { using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial class OrganizationResourceUpdateTags { /// @@ -61,61 +61,44 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal OrganizationResourceUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +113,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal OrganizationResourceUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +130,27 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial interface IOrganizationResourceUpdateTags { diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs similarity index 83% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs index 921f82d4aab..c511f242d65 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class OrganizationResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return OrganizationResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +126,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IUserAssigned } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs new file mode 100644 index 00000000000..c8d24fa1642 --- /dev/null +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTagsInternal + { + + /// Creates an new instance. + public OrganizationResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IOrganizationResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..7ecffd1de83 --- /dev/null +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; + + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.OrganizationResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs new file mode 100644 index 00000000000..f495dcd50a7 --- /dev/null +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json ? new OrganizationResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OrganizationResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index cd93b351cc8..ba0a1c5e33b 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.cs index 8f889df0292..8af70d6c3d1 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Origin(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.json.cs index cdcb4fe4fd1..7ecb6c05fa9 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.J return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index cdb59c3a4cb..35399b1a87b 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 1a53523e5c7..0d5c3068f1d 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Convert } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 60% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.cs index 31ab59b9d13..e4a00b5faba 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 0a7e5bea226..9bb9c893ef4 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models { using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 48038fa8c6f..dc22ddf55fa 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models using static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonNode ToJso AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateExpanded.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateExpanded.cs index 8f49a7e5eab..de98d8cc569 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateExpanded.cs @@ -342,8 +342,8 @@ public partial class NewAzLambdaTestOrganization_CreateExpanded : global::System ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateViaIdentityExpanded.cs index b727b618e30..7ea9412d5f2 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/NewAzLambdaTestOrganization_CreateViaIdentityExpanded.cs @@ -302,8 +302,8 @@ public partial class NewAzLambdaTestOrganization_CreateViaIdentityExpanded : glo ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/SetAzLambdaTestOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/SetAzLambdaTestOrganization_UpdateExpanded.cs index f5aedc70faa..4a0377fe2ab 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/SetAzLambdaTestOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/SetAzLambdaTestOrganization_UpdateExpanded.cs @@ -343,8 +343,8 @@ public partial class SetAzLambdaTestOrganization_UpdateExpanded : global::System ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateExpanded.cs index d98e7b82519..bb5bec7cfbe 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateExpanded.cs @@ -331,8 +331,8 @@ public partial class UpdateAzLambdaTestOrganization_UpdateExpanded : global::Sys ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -748,7 +748,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -762,10 +762,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -798,6 +794,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateViaIdentityExpanded.cs index 0ecd0a58982..2503909378c 100644 --- a/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/LambdaTest.HyperExecute.Management/target/generated/cmdlets/UpdateAzLambdaTestOrganization_UpdateViaIdentityExpanded.cs @@ -291,8 +291,8 @@ public partial class UpdateAzLambdaTestOrganization_UpdateViaIdentityExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -730,7 +730,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.LambdaTest.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -744,10 +744,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -780,6 +776,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index ba06606b114..e2f3d387808 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceProperties.PowerShell.cs index aa5b81c5970..e5d53fd546b 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceProperties.PowerShell.cs @@ -147,10 +147,6 @@ internal InstanceProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -187,6 +183,10 @@ internal InstanceProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -268,10 +268,6 @@ internal InstanceProperties(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -308,6 +304,10 @@ internal InstanceProperties(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstancePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.PowerShell.cs index ed813daaa0a..b27e029aad5 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.PowerShell.cs @@ -167,7 +167,7 @@ internal InstanceResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -213,10 +213,6 @@ internal InstanceResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -231,7 +227,7 @@ internal InstanceResource(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -269,6 +265,10 @@ internal InstanceResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -368,7 +368,7 @@ internal InstanceResource(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -414,10 +414,6 @@ internal InstanceResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -432,7 +428,7 @@ internal InstanceResource(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -470,6 +466,10 @@ internal InstanceResource(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.cs index 4cfccc54b02..344e2f8802d 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResource.cs @@ -57,7 +57,7 @@ public partial class InstanceResource : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Inherited)] @@ -243,7 +243,7 @@ public partial class InstanceResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -364,8 +364,8 @@ public partial interface IInstanceResource : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Info( Required = false, @@ -634,7 +634,7 @@ internal partial interface IInstanceResourceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details of the resource. Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IMarketplaceDetails Marketplace { get; set; } /// Offer details for the marketplace that is selected by the user diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.PowerShell.cs index 0c679036505..46c46203bb3 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.PowerShell.cs @@ -113,7 +113,7 @@ internal InstanceResourceUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.InstanceResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -129,7 +129,7 @@ internal InstanceResourceUpdate(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal InstanceResourceUpdate(global::System.Management.Automation.PSObject co } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.InstanceResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -170,7 +170,7 @@ internal InstanceResourceUpdate(global::System.Management.Automation.PSObject co } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.cs index 4ed1f57585d..57aa5d5dc52 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.cs @@ -36,7 +36,7 @@ public partial class InstanceResourceUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentity()); set { {_identity = value;} } } @@ -48,11 +48,11 @@ public partial class InstanceResourceUpdate : string Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.InstanceResourceUpdateTags()); set => this._tag = value; } /// Creates an new instance. public InstanceResourceUpdate() @@ -111,8 +111,8 @@ public partial interface IInstanceResourceUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Info( Required = false, @@ -122,8 +122,8 @@ public partial interface IInstanceResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags Tag { get; set; } } /// The type used for update operations of the Instance Resource. @@ -144,9 +144,9 @@ internal partial interface IInstanceResourceUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.json.cs index d2a17b4ce5b..ce95f40f6ea 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdate.json.cs @@ -76,7 +76,7 @@ internal InstanceResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases return; } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.InstanceResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.PowerShell.cs similarity index 80% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.PowerShell.cs index e521612cbbe..18ccea1def5 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models { using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(InstanceResourceUpdateTagsTypeConverter))] + public partial class InstanceResourceUpdateTags { /// @@ -61,61 +61,44 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new InstanceResourceUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new InstanceResourceUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal InstanceResourceUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +113,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal InstanceResourceUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +130,27 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(InstanceResourceUpdateTagsTypeConverter))] + public partial interface IInstanceResourceUpdateTags { diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.TypeConverter.cs index 7763727a32f..9dcd2f98831 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class InstanceResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return InstanceResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssig } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return InstanceResourceUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return InstanceResourceUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.cs new file mode 100644 index 00000000000..dfa3735dafa --- /dev/null +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; + + /// Resource tags. + public partial class InstanceResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTagsInternal + { + + /// Creates an new instance. + public InstanceResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IInstanceResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IInstanceResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..4a38582cc1a --- /dev/null +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; + + public partial class InstanceResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.InstanceResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.json.cs new file mode 100644 index 00000000000..3c13abb0848 --- /dev/null +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/InstanceResourceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; + + /// Resource tags. + public partial class InstanceResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IInstanceResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json ? new InstanceResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject instance to deserialize from. + /// + internal InstanceResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index bbca14532d4..37e453239ab 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 106be5c9da1..6b9ca5846ea 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index b7d529d7a8d..acd5326290d 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..9e06f5ff535 --- /dev/null +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..edcf64bdeae --- /dev/null +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 4c089185b11..a1b4d5df9c7 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index 2ce904a50da..0289a248d53 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models { using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index 247c60734ae..1a2b2855efa 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode To AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index d29c6538a90..af0568aac68 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.cs index e22f88820e6..4835b7c9e1e 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Origin(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.json.cs index 23b7140870a..1e5dc60d3c5 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtim return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 6365d495fca..80007524dfa 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index f05d762f0ae..292d7c6bb8e 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Conv } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.cs index 8fe4347b55a..1c4530cc075 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index f775af76bef..345df20330a 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models { using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 0bc22363c6b..9102fe27ff0 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models using static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonNode To AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateExpanded.cs index 074c18c20ca..6f7ba4c9073 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateExpanded.cs @@ -354,8 +354,8 @@ public partial class NewAzWeightsBiasesInstance_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateViaIdentityExpanded.cs index a957d97fcb8..407764863d5 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/NewAzWeightsBiasesInstance_CreateViaIdentityExpanded.cs @@ -314,8 +314,8 @@ public partial class NewAzWeightsBiasesInstance_CreateViaIdentityExpanded : glob ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/SetAzWeightsBiasesInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/SetAzWeightsBiasesInstance_UpdateExpanded.cs index f32442f202d..f69529b98ce 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/SetAzWeightsBiasesInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/SetAzWeightsBiasesInstance_UpdateExpanded.cs @@ -355,8 +355,8 @@ public partial class SetAzWeightsBiasesInstance_UpdateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateExpanded.cs index 82d525d5129..e0bce420fa9 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateExpanded.cs @@ -343,8 +343,8 @@ public partial class UpdateAzWeightsBiasesInstance_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -760,7 +760,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -774,10 +774,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -814,6 +810,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateViaIdentityExpanded.cs index 15a2a7e41ab..0581f1e5df3 100644 --- a/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Liftr.WeightsAndBiases.Management/target/generated/cmdlets/UpdateAzWeightsBiasesInstance_UpdateViaIdentityExpanded.cs @@ -303,8 +303,8 @@ public partial class UpdateAzWeightsBiasesInstance_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -740,7 +740,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.WeightsBiases.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -754,10 +754,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -794,6 +790,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index cff0fc5d50d..b3fb1d0792f 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index 38c1e2f859b..030ff2f2ebb 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 54f1d2baedd..4e8fe7033a1 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index a3aad90f76c..8dae4d88d7d 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrast {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..27ce1de1fb1 --- /dev/null +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..5004aa47126 --- /dev/null +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index 038994aead9..a65ff276771 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 97% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index 655526eeeff..d6364dbe797 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models { using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index ae669a8e20d..11874319833 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.Json AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.PowerShell.cs index 7dd4e7cc816..419ddcd4bbf 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.PowerShell.cs @@ -163,7 +163,7 @@ internal Pool(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -211,7 +211,7 @@ internal Pool(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("OrganizationProfileKind")) { @@ -304,7 +304,7 @@ internal Pool(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -352,7 +352,7 @@ internal Pool(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("OrganizationProfileKind")) { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.cs index b57b77894d5..01f1ee3b058 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Pool.cs @@ -79,7 +79,7 @@ public partial class Pool : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Inherited)] @@ -212,7 +212,7 @@ public partial class Pool : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -343,8 +343,8 @@ public partial interface IPool : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Defines how many resources can there be created at any given time. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Info( Required = false, @@ -436,7 +436,7 @@ internal partial interface IPoolInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Defines how many resources can there be created at any given time. int? MaximumConcurrency { get; set; } /// Defines the organization in which the pool will be used. diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.PowerShell.cs index 17c05445003..678f2ec7aed 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.PowerShell.cs @@ -117,7 +117,7 @@ internal PoolUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("OrganizationProfile")) { @@ -149,7 +149,7 @@ internal PoolUpdate(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MaximumConcurrency")) { @@ -210,7 +210,7 @@ internal PoolUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("OrganizationProfile")) { @@ -242,7 +242,7 @@ internal PoolUpdate(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MaximumConcurrency")) { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.cs index bd02928894c..4cbf88ddc0f 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.cs @@ -64,7 +64,7 @@ public partial class PoolUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Defines how many resources can there be created at any given time. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Inlined)] @@ -118,11 +118,11 @@ public partial class PoolUpdate : public string ResourcePredictionProfileKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdatePropertiesInternal)Property).ResourcePredictionProfileKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdatePropertiesInternal)Property).ResourcePredictionProfileKind = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateTags()); set => this._tag = value; } /// Creates an new instance. public PoolUpdate() @@ -225,8 +225,8 @@ public partial interface IPoolUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Defines how many resources can there be created at any given time. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Info( Required = false, @@ -282,8 +282,8 @@ public partial interface IPoolUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags Tag { get; set; } } /// The type used for update operations of the Pool. @@ -318,7 +318,7 @@ internal partial interface IPoolUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Defines how many resources can there be created at any given time. int? MaximumConcurrency { get; set; } /// Defines the organization in which the pool will be used. @@ -334,7 +334,7 @@ internal partial interface IPoolUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PSArgumentCompleterAttribute("Manual", "Automatic")] string ResourcePredictionProfileKind { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.json.cs index ef83ef9b5bd..c99aec8725f 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdate.json.cs @@ -77,7 +77,7 @@ internal PoolUpdate(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runt } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.PowerShell.cs index 8921ba3f1b2..8025aaeaffc 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(PoolUpdateTagsTypeConverter))] + public partial class PoolUpdateTags { /// @@ -61,44 +61,44 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new PoolUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new PoolUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal PoolUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +113,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal PoolUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -149,8 +149,8 @@ public override string ToString() } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(PoolUpdateTagsTypeConverter))] + public partial interface IPoolUpdateTags { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.TypeConverter.cs index f7826b57ade..0d1193cbd49 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class PoolUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return PoolUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITa } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return PoolUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return PoolUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.cs similarity index 73% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.cs index 5e13ea00a81..60e7a203956 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITagsInternal + public partial class PoolUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public PoolUpdateTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface IPoolUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface IPoolUpdateTagsInternal { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.dictionary.cs index 7d069a1b3c6..fb8bc77354f 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models { using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; - public partial class Tags : + public partial class PoolUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.PoolUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.json.cs index ac5ce758790..286541438e5 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/PoolUpdateTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class PoolUpdateTags { /// @@ -52,23 +52,23 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IPoolUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json ? new Tags(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json ? new PoolUpdateTags(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject instance to deserialize from. /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal PoolUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -81,13 +81,13 @@ internal Tags(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Js } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ResourceSku.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ResourceSku.PowerShell.cs index 0da793a5877..9a8f9ef92ac 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ResourceSku.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/ResourceSku.PowerShell.cs @@ -151,22 +151,6 @@ internal ResourceSku(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("LocationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo = (System.Collections.Generic.List) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuLocationInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Restriction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction = (System.Collections.Generic.List) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); - } if (content.Contains("ResourceType")) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).ResourceType, global::System.Convert.ToString); @@ -183,6 +167,22 @@ internal ResourceSku(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Family, global::System.Convert.ToString); } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LocationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo = (System.Collections.Generic.List) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuLocationInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction = (System.Collections.Generic.List) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -244,22 +244,6 @@ internal ResourceSku(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - if (content.Contains("LocationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo = (System.Collections.Generic.List) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuLocationInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); - } - if (content.Contains("Restriction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction = (System.Collections.Generic.List) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); - } if (content.Contains("ResourceType")) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).ResourceType, global::System.Convert.ToString); @@ -276,6 +260,22 @@ internal ResourceSku(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Family, global::System.Convert.ToString); } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LocationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo = (System.Collections.Generic.List) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuLocationInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuCapabilitiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction = (System.Collections.Generic.List) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceSkuInternal)this).Restriction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ResourceSkuRestrictionsTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index e8b84bccd87..849352037b9 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.cs index dc16d089ab2..7e45f57dbaf 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.cs @@ -97,11 +97,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Origin(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -152,8 +152,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -163,7 +163,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.json.cs index 446d9637895..36ff74d63d4 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 40f99ef7cbd..47324e9ebdb 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models { using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,37 +61,37 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -111,11 +111,11 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +130,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -148,9 +148,9 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co AfterDeserializePSObject(content); } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index ea7f53c5038..7f38c2f3c0f 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models using Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.IUs } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 00000000000..fb27d691d83 --- /dev/null +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 00000000000..041108dd560 --- /dev/null +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.json.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.json.cs new file mode 100644 index 00000000000..acc3510c2a3 --- /dev/null +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateExpanded.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateExpanded.cs index 5ee36744a3f..fcfbb6546c2 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateExpanded.cs @@ -286,8 +286,8 @@ public partial class NewAzDevOpsInfrastructurePool_CreateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateViaIdentityExpanded.cs index be9d50eada3..92326f1e9ba 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/NewAzDevOpsInfrastructurePool_CreateViaIdentityExpanded.cs @@ -246,8 +246,8 @@ public partial class NewAzDevOpsInfrastructurePool_CreateViaIdentityExpanded : g ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/SetAzDevOpsInfrastructurePool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/SetAzDevOpsInfrastructurePool_UpdateExpanded.cs index 8dfa01a797e..26f38413c58 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/SetAzDevOpsInfrastructurePool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/SetAzDevOpsInfrastructurePool_UpdateExpanded.cs @@ -287,8 +287,8 @@ public partial class SetAzDevOpsInfrastructurePool_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateExpanded.cs index f8b05a13026..6ebfc136906 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateExpanded.cs @@ -275,8 +275,8 @@ public partial class UpdateAzDevOpsInfrastructurePool_UpdateExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -637,7 +637,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ProvisioningState"))) { diff --git a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateViaIdentityExpanded.cs index a1930c005e2..2048900c4c4 100644 --- a/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Microsoft.DevOpsInfrastructure.Management/target/generated/cmdlets/UpdateAzDevOpsInfrastructurePool_UpdateViaIdentityExpanded.cs @@ -235,8 +235,8 @@ public partial class UpdateAzDevOpsInfrastructurePool_UpdateViaIdentityExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -619,7 +619,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.DevOpsInfrastructure.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ProvisioningState"))) { diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 0724a28b5ed..9f836621385 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs index b7bd5bec5e9..060b9a7ad16 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs @@ -161,7 +161,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -366,7 +366,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.cs index 6f42d22b061..d56fc79654b 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/OrganizationResource.cs @@ -225,7 +225,7 @@ public partial class OrganizationResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Origin(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 8ef1af503f3..87729398ffd 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.cs index 9d667ed4622..ca118074630 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Origin(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.json.cs index 7029de254ed..e616ad4bb27 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index a7623ce620a..8bb292e2601 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models using Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index a49a30f6a0c..faee05e6b9f 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models using Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Conve } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.cs index fa234e46a0a..d229e17000d 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models using static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 91190f91f8a..08f971b801e 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 025adc9b42a..630930907b7 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models using static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonNode ToJ AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateExpanded.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateExpanded.cs index 6b42a99bb16..1a026063b0e 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateExpanded.cs @@ -413,8 +413,8 @@ public partial class NewAzNeonPostgresOrganization_CreateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateViaIdentityExpanded.cs index a0b14ad17cb..4039c365a99 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/NewAzNeonPostgresOrganization_CreateViaIdentityExpanded.cs @@ -373,8 +373,8 @@ public partial class NewAzNeonPostgresOrganization_CreateViaIdentityExpanded : g ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/SetAzNeonPostgresOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/SetAzNeonPostgresOrganization_UpdateExpanded.cs index 20e97802df6..5a02161a4d0 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/SetAzNeonPostgresOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/SetAzNeonPostgresOrganization_UpdateExpanded.cs @@ -414,8 +414,8 @@ public partial class SetAzNeonPostgresOrganization_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateExpanded.cs index 417e5bca4dc..41286e2cda1 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateExpanded.cs @@ -313,8 +313,8 @@ public partial class UpdateAzNeonPostgresOrganization_UpdateExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] diff --git a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateViaIdentityExpanded.cs index 94ba3d08204..a94842d7e12 100644 --- a/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Neon.Postgres.Management/target/generated/cmdlets/UpdateAzNeonPostgresOrganization_UpdateViaIdentityExpanded.cs @@ -273,8 +273,8 @@ public partial class UpdateAzNeonPostgresOrganization_UpdateViaIdentityExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.ITrackedResourceTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Email address of the user [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address of the user")] diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.PowerShell.cs index 8ba48a6ddcf..2990d7d651e 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.PowerShell.cs @@ -128,7 +128,7 @@ internal DataProduct(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -138,10 +138,6 @@ internal DataProduct(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("Owner")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("CustomerEncryptionKey")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).CustomerEncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IEncryptionKeyDetails) content.GetValueForProperty("CustomerEncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).CustomerEncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); @@ -174,6 +170,10 @@ internal DataProduct(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).MajorVersion = (string) content.GetValueForProperty("MajorVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).MajorVersion, global::System.Convert.ToString); } + if (content.Contains("Owner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("Redundancy")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Redundancy = (string) content.GetValueForProperty("Redundancy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Redundancy, global::System.Convert.ToString); @@ -214,10 +214,6 @@ internal DataProduct(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).KeyVaultUrl, global::System.Convert.ToString); } - if (content.Contains("NetworkaclIPRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkaclDefaultAction")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclDefaultAction = (string) content.GetValueForProperty("NetworkaclDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclDefaultAction, global::System.Convert.ToString); @@ -236,7 +232,7 @@ internal DataProduct(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("CustomerEncryptionKeyVaultUri")) { @@ -254,6 +250,10 @@ internal DataProduct(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclVirtualNetworkRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclVirtualNetworkRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.VirtualNetworkRuleTypeConverter.ConvertFrom)); } + if (content.Contains("NetworkaclIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); + } if (content.Contains("NetworkaclAllowedQueryIPRangeList")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclAllowedQueryIPRangeList = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclAllowedQueryIPRangeList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclAllowedQueryIPRangeList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -361,7 +361,7 @@ internal DataProduct(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -371,10 +371,6 @@ internal DataProduct(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).ProvisioningState, global::System.Convert.ToString); } - if (content.Contains("Owner")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("CustomerEncryptionKey")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).CustomerEncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IEncryptionKeyDetails) content.GetValueForProperty("CustomerEncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).CustomerEncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); @@ -407,6 +403,10 @@ internal DataProduct(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).MajorVersion = (string) content.GetValueForProperty("MajorVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).MajorVersion, global::System.Convert.ToString); } + if (content.Contains("Owner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("Redundancy")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Redundancy = (string) content.GetValueForProperty("Redundancy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).Redundancy, global::System.Convert.ToString); @@ -447,10 +447,6 @@ internal DataProduct(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).KeyVaultUrl, global::System.Convert.ToString); } - if (content.Contains("NetworkaclIPRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkaclDefaultAction")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclDefaultAction = (string) content.GetValueForProperty("NetworkaclDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclDefaultAction, global::System.Convert.ToString); @@ -469,7 +465,7 @@ internal DataProduct(global::System.Management.Automation.PSObject content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("CustomerEncryptionKeyVaultUri")) { @@ -487,6 +483,10 @@ internal DataProduct(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclVirtualNetworkRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclVirtualNetworkRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.VirtualNetworkRuleTypeConverter.ConvertFrom)); } + if (content.Contains("NetworkaclIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); + } if (content.Contains("NetworkaclAllowedQueryIPRangeList")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclAllowedQueryIPRangeList = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclAllowedQueryIPRangeList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductInternal)this).NetworkaclAllowedQueryIPRangeList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.cs index 15e35113022..7f15f32a40e 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProduct.cs @@ -101,7 +101,7 @@ public partial class DataProduct : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Key vault url. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Inlined)] @@ -321,7 +321,7 @@ public partial class DataProduct : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -552,8 +552,8 @@ public partial interface IDataProduct : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Key vault url. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Info( Required = false, @@ -821,7 +821,7 @@ internal partial interface IDataProductInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Key vault url. string KeyVaultUrl { get; set; } /// Major version of data product. diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductProperties.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductProperties.PowerShell.cs index a33955b3394..9bbee6042c9 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductProperties.PowerShell.cs @@ -154,10 +154,6 @@ internal DataProductProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); } - if (content.Contains("NetworkaclIPRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkaclDefaultAction")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclDefaultAction = (string) content.GetValueForProperty("NetworkaclDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclDefaultAction, global::System.Convert.ToString); @@ -178,6 +174,10 @@ internal DataProductProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclVirtualNetworkRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclVirtualNetworkRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.VirtualNetworkRuleTypeConverter.ConvertFrom)); } + if (content.Contains("NetworkaclIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); + } if (content.Contains("NetworkaclAllowedQueryIPRangeList")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclAllowedQueryIPRangeList = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclAllowedQueryIPRangeList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclAllowedQueryIPRangeList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); @@ -311,10 +311,6 @@ internal DataProductProperties(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); } - if (content.Contains("NetworkaclIPRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); - } if (content.Contains("NetworkaclDefaultAction")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclDefaultAction = (string) content.GetValueForProperty("NetworkaclDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclDefaultAction, global::System.Convert.ToString); @@ -335,6 +331,10 @@ internal DataProductProperties(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclVirtualNetworkRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclVirtualNetworkRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.VirtualNetworkRuleTypeConverter.ConvertFrom)); } + if (content.Contains("NetworkaclIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclIPRule",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclIPRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IPRulesTypeConverter.ConvertFrom)); + } if (content.Contains("NetworkaclAllowedQueryIPRangeList")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclAllowedQueryIPRangeList = (System.Collections.Generic.List) content.GetValueForProperty("NetworkaclAllowedQueryIPRangeList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductPropertiesInternal)this).NetworkaclAllowedQueryIPRangeList, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.PowerShell.cs index 6c25dd569b4..e0838cf03b2 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.PowerShell.cs @@ -84,11 +84,7 @@ internal DataProductUpdate(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Owner")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -104,7 +100,11 @@ internal DataProductUpdate(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Owner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("PurviewAccount")) { @@ -149,11 +149,7 @@ internal DataProductUpdate(global::System.Management.Automation.PSObject content } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Owner")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -169,7 +165,11 @@ internal DataProductUpdate(global::System.Management.Automation.PSObject content } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Owner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner = (System.Collections.Generic.List) content.GetValueForProperty("Owner",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal)this).Owner, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("PurviewAccount")) { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.cs index 63cddcd553c..79945900813 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.cs @@ -40,7 +40,7 @@ public partial class DataProductUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4 Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4()); set { {_identity = value;} } } @@ -78,11 +78,11 @@ public partial class DataProductUpdate : public string PurviewCollection { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdatePropertiesInternal)Property).PurviewCollection; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdatePropertiesInternal)Property).PurviewCollection = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateTags()); set => this._tag = value; } /// Creates an new instance. public DataProductUpdate() @@ -152,8 +152,8 @@ public partial interface IDataProductUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// List of name or email associated with data product resource deployment. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Info( Required = false, @@ -208,8 +208,8 @@ public partial interface IDataProductUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags Tag { get; set; } } /// The type used for update operations of the DataProduct. @@ -232,7 +232,7 @@ internal partial interface IDataProductUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// List of name or email associated with data product resource deployment. System.Collections.Generic.List Owner { get; set; } /// Flag to enable or disable private link for data product resource. @@ -245,7 +245,7 @@ internal partial interface IDataProductUpdateInternal /// Purview collection url for data product to connect to. string PurviewCollection { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.json.cs index 1b5fa6ab8d1..b6aba855a71 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.json.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdate.json.cs @@ -65,7 +65,7 @@ internal DataProductUpdate(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.R } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.PowerShell.cs index cfd996f7c17..411b9eaeda4 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(DataProductUpdateTagsTypeConverter))] + public partial class DataProductUpdateTags { /// @@ -61,37 +61,75 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DataProductUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataProductUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new DataProductUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new DataProductUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -109,48 +147,10 @@ public override string ToString() } return ToJsonString(); } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(DataProductUpdateTagsTypeConverter))] + public partial interface IDataProductUpdateTags { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.TypeConverter.cs index c8adc446f62..3cd2244207d 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class DataProductUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return DataProductUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAs } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return DataProductUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return DataProductUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.cs new file mode 100644 index 00000000000..1b8ab8f7ef6 --- /dev/null +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; + + /// Resource tags. + public partial class DataProductUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTagsInternal + { + + /// Creates an new instance. + public DataProductUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IDataProductUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IDataProductUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.dictionary.cs new file mode 100644 index 00000000000..57b4401ec15 --- /dev/null +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; + + public partial class DataProductUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.DataProductUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.json.cs new file mode 100644 index 00000000000..774cdba75da --- /dev/null +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/DataProductUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; + + /// Resource tags. + public partial class DataProductUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DataProductUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IDataProductUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json ? new DataProductUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 1a3e6a02c8e..b0ad371a37c 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs index 4501d22fe4a..6d4e8e4a66b 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentityV4(global::System.Collections.IDictionary content } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentityV4(global::System.Management.Automation.PSObject } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs index 99be9693d90..5ddaddcc4c5 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentityV4 : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentityV4() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentityV4 : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityV4Internal [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs index e828f1e4b3e..b877d56cf6c 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentityV4(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnal {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..e5caaec87fb --- /dev/null +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityV4UserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityV4UserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityV4UserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityV4UserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityV4UserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityV4UserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..17616290c0f --- /dev/null +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityV4UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityV4UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityV4UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityV4UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs similarity index 65% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs index c164b97a600..7bee5c4bb31 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityV4UserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityV4UserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityV4UserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityV4UserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs index bd94febbdcf..000263b501d 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityV4UserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ManagedServiceIdentityV4UserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs index dfc3cfead81..710b47ebc27 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/ManagedServiceIdentityV4UserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityV4UserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IManagedServiceIdentityV4UserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json ? new ManagedServiceIdentityV4UserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityV4UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 5d7975e4765..d7c0ce3f9c9 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.cs index 79359e7e6b5..b8011306043 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.json.cs index 8ef66e1cc36..8aa221c06f7 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Run return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 81% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index c1decebcae2..6c58e257bbb 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 82e7d803d27..e3b610ca4e5 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags C } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.cs index f5d81a37c4b..110564fa38b 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index cecde1bcf71..35e03f479a8 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.json.cs index 6ea10480440..6d925fb409a 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models using static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,42 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json ? new Tags(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.SerializationMode serializationMode) { @@ -103,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonNode AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateExpanded.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateExpanded.cs index d93f9f868b1..4af76717379 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateExpanded.cs @@ -414,8 +414,8 @@ public partial class NewAzNetworkAnalyticsDataProduct_CreateExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateViaIdentityExpanded.cs index eba2b22e47e..78a7e17b384 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/NewAzNetworkAnalyticsDataProduct_CreateViaIdentityExpanded.cs @@ -374,8 +374,8 @@ public partial class NewAzNetworkAnalyticsDataProduct_CreateViaIdentityExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateExpanded.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateExpanded.cs index 1db6446bcb6..22e540160bb 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateExpanded.cs @@ -240,8 +240,8 @@ public partial class UpdateAzNetworkAnalyticsDataProduct_UpdateExpanded : global ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -602,7 +602,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Owner"))) { diff --git a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateViaIdentityExpanded.cs index b509465a19c..751ff54eb36 100644 --- a/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/NetworkAnalytics.Management/target/generated/cmdlets/UpdateAzNetworkAnalyticsDataProduct_UpdateViaIdentityExpanded.cs @@ -200,8 +200,8 @@ public partial class UpdateAzNetworkAnalyticsDataProduct_UpdateViaIdentityExpand ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -585,7 +585,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkAnalytics.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Owner"))) { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 319e9a900c0..8aefc3016d8 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index 0a0506c784f..a8ae048ced3 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.cs index e1d234afc21..ddbee8236b3 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index a95ecc0a14b..be4bebe9e25 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runt {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..d258f0ae70a --- /dev/null +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..8245be6d78e --- /dev/null +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 57% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index da813299a41..94ba12a67c2 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index 51e0d16b3b8..23059afd6f6 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index 0477b5cd20a..1c4921fcb84 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode ToJson( AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs index 51334517ce5..89d854ec637 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationProperties.PowerShell.cs @@ -143,10 +143,6 @@ internal OrganizationProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -183,6 +179,10 @@ internal OrganizationProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -260,10 +260,6 @@ internal OrganizationProperties(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("MarketplaceSubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId = (string) content.GetValueForProperty("MarketplaceSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).MarketplaceSubscriptionId, global::System.Convert.ToString); @@ -300,6 +296,10 @@ internal OrganizationProperties(global::System.Management.Automation.PSObject co { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationPropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs index 276719087fc..8b1b620c84c 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.PowerShell.cs @@ -167,7 +167,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -209,10 +209,6 @@ internal OrganizationResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -227,7 +223,7 @@ internal OrganizationResource(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -265,6 +261,10 @@ internal OrganizationResource(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); @@ -364,7 +364,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -406,10 +406,6 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl = (string) content.GetValueForProperty("SingleSignOnPropertyUrl",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyUrl, global::System.Convert.ToString); } - if (content.Contains("SingleSignOnPropertyAadDomain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("IdentityPrincipalId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); @@ -424,7 +420,7 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceSubscriptionId")) { @@ -462,6 +458,10 @@ internal OrganizationResource(global::System.Management.Automation.PSObject cont { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId = (string) content.GetValueForProperty("SingleSignOnPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyEnterpriseAppId, global::System.Convert.ToString); } + if (content.Contains("SingleSignOnPropertyAadDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain = (System.Collections.Generic.List) content.GetValueForProperty("SingleSignOnPropertyAadDomain",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).SingleSignOnPropertyAadDomain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("OfferDetailPublisherId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.cs index 021ccc70b14..cf4a4010d54 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResource.cs @@ -56,7 +56,7 @@ public partial class OrganizationResource : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Inherited)] @@ -238,7 +238,7 @@ public partial class OrganizationResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -359,8 +359,8 @@ public partial interface IOrganizationResource : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Azure subscription id for the the marketplace offer is purchased from [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Info( Required = false, @@ -617,7 +617,7 @@ internal partial interface IOrganizationResourceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details of the resource. Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IMarketplaceDetails Marketplace { get; set; } /// Offer details for the marketplace that is selected by the user diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs index 2fff39e3217..3b0fae40451 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs @@ -113,7 +113,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -129,7 +129,7 @@ internal OrganizationResourceUpdate(global::System.Collections.IDictionary conte } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityPrincipalId")) { @@ -170,7 +170,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.cs index bc124a1aebd..77cfb4c7fad 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.cs @@ -36,7 +36,7 @@ public partial class OrganizationResourceUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for Identity Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentity()); set { {_identity = value;} } } @@ -48,11 +48,11 @@ public partial class OrganizationResourceUpdate : string Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.OrganizationResourceUpdateTags()); set => this._tag = value; } /// Creates an new instance. public OrganizationResourceUpdate() @@ -111,8 +111,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Info( Required = false, @@ -122,8 +122,8 @@ public partial interface IOrganizationResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags Tag { get; set; } } /// The type used for update operations of the Organization Resource. @@ -144,9 +144,9 @@ internal partial interface IOrganizationResourceUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs index ab4c3c8ecf0..4e7cdb7584c 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdate.json.cs @@ -76,7 +76,7 @@ internal OrganizationResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.Pinecone. return; } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.OrganizationResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs index 311d548729d..b37d6dea9a9 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models { using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial class OrganizationResourceUpdateTags { /// @@ -61,61 +61,44 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new OrganizationResourceUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal OrganizationResourceUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +113,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal OrganizationResourceUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +130,27 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] + public partial interface IOrganizationResourceUpdateTags { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs similarity index 83% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs index 74631fbeea6..9f0033450c3 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class OrganizationResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return OrganizationResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +126,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IUserAssignedId } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return OrganizationResourceUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs new file mode 100644 index 00000000000..f5de54b2dee --- /dev/null +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTagsInternal + { + + /// Creates an new instance. + public OrganizationResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IOrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IOrganizationResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..ac498a98f1a --- /dev/null +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; + + public partial class OrganizationResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.OrganizationResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs new file mode 100644 index 00000000000..cfaee1fdacc --- /dev/null +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/OrganizationResourceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; + + /// Resource tags. + public partial class OrganizationResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json ? new OrganizationResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OrganizationResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 8f29827be1b..85a6ec38940 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.cs index 22bea383f76..7301463b9f5 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Origin(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.json.cs index 08ba84fdd57..5e13da01bac 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Jso return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index abc3161c456..92d7df34d30 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index f363855bfa6..9188dcc13c4 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags ConvertFr } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 60% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.cs index d14824be75a..cd75b62bc6f 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 3f29959c97f..4108f36d1b6 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.json.cs index f0ea067af33..1f6f3b6198d 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models using static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonNode ToJson( AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateExpanded.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateExpanded.cs index 7bac165add6..80e662b82aa 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateExpanded.cs @@ -342,8 +342,8 @@ public partial class NewAzPineconeOrganization_CreateExpanded : global::System.M ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateViaIdentityExpanded.cs index 9ae3ef19a55..4335ab9d0a8 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/NewAzPineconeOrganization_CreateViaIdentityExpanded.cs @@ -302,8 +302,8 @@ public partial class NewAzPineconeOrganization_CreateViaIdentityExpanded : globa ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/SetAzPineconeOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/SetAzPineconeOrganization_UpdateExpanded.cs index b709c04e38c..f419cb3b14f 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/SetAzPineconeOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/SetAzPineconeOrganization_UpdateExpanded.cs @@ -343,8 +343,8 @@ public partial class SetAzPineconeOrganization_UpdateExpanded : global::System.M ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateExpanded.cs index a53aac55f78..d2442ef07af 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateExpanded.cs @@ -331,8 +331,8 @@ public partial class UpdateAzPineconeOrganization_UpdateExpanded : global::Syste ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -748,7 +748,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -758,10 +758,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -798,6 +794,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateViaIdentityExpanded.cs index cfac090eefb..97d976f7c0d 100644 --- a/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Pinecone.VectorDb.Management/target/generated/cmdlets/UpdateAzPineconeOrganization_UpdateViaIdentityExpanded.cs @@ -291,8 +291,8 @@ public partial class UpdateAzPineconeOrganization_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -728,7 +728,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Pinecone.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UserEmailAddress"))) { @@ -738,10 +738,6 @@ private void Update_resourceBody() { this.SingleSignOnPropertyUrl = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyUrl"]); } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) - { - this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); - } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplaceSubscriptionId"))) { this.MarketplaceSubscriptionId = (string)(this.MyInvocation?.BoundParameters["MarketplaceSubscriptionId"]); @@ -778,6 +774,10 @@ private void Update_resourceBody() { this.SingleSignOnPropertyEnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["SingleSignOnPropertyEnterpriseAppId"]); } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnPropertyAadDomain"))) + { + this.SingleSignOnPropertyAadDomain = (string[])(this.MyInvocation?.BoundParameters["SingleSignOnPropertyAadDomain"]); + } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OfferDetailPublisherId"))) { this.OfferDetailPublisherId = (string)(this.MyInvocation?.BoundParameters["OfferDetailPublisherId"]); diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 068fb8bd52d..2a327d1c293 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.PowerShell.cs index dda8b486ade..dcf89fcfb68 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.PowerShell.cs @@ -160,7 +160,7 @@ internal FileSystemResource(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -216,7 +216,7 @@ internal FileSystemResource(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceDetailMarketplaceSubscriptionId")) { @@ -321,7 +321,7 @@ internal FileSystemResource(global::System.Management.Automation.PSObject conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -377,7 +377,7 @@ internal FileSystemResource(global::System.Management.Automation.PSObject conten } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceDetailMarketplaceSubscriptionId")) { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.cs index a72072ac3d7..7d9b9d4aa23 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResource.cs @@ -72,7 +72,7 @@ public partial class FileSystemResource : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inherited)] @@ -221,7 +221,7 @@ public partial class FileSystemResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -371,8 +371,8 @@ public partial interface IFileSystemResource : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace Subscription Id [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Info( Required = false, @@ -526,7 +526,7 @@ internal partial interface IFileSystemResourceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IMarketplaceDetails MarketplaceDetail { get; set; } /// Marketplace Subscription Id diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.PowerShell.cs index 0a6600266ee..1f47e21c696 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.PowerShell.cs @@ -110,7 +110,7 @@ internal FileSystemResourceUpdate(global::System.Collections.IDictionary content } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceDetail")) { @@ -134,7 +134,7 @@ internal FileSystemResourceUpdate(global::System.Collections.IDictionary content } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("DelegatedSubnetId")) { @@ -195,7 +195,7 @@ internal FileSystemResourceUpdate(global::System.Management.Automation.PSObject } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("MarketplaceDetail")) { @@ -219,7 +219,7 @@ internal FileSystemResourceUpdate(global::System.Management.Automation.PSObject } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("DelegatedSubnetId")) { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.cs index 650ead5b296..f47e1fcb22e 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.cs @@ -40,7 +40,7 @@ public partial class FileSystemResourceUpdate : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Marketplace Subscription Id [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inlined)] @@ -95,11 +95,11 @@ public partial class FileSystemResourceUpdate : internal Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateTags()); set => this._tag = value; } /// User Email [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Inlined)] @@ -173,8 +173,8 @@ public partial interface IFileSystemResourceUpdate : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace Subscription Id [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Info( Required = false, @@ -251,8 +251,8 @@ public partial interface IFileSystemResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags Tag { get; set; } /// User Email [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Info( Required = false, @@ -286,7 +286,7 @@ internal partial interface IFileSystemResourceUpdateInternal [global::Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Marketplace details Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IMarketplaceDetails MarketplaceDetail { get; set; } /// Marketplace Subscription Id @@ -305,7 +305,7 @@ internal partial interface IFileSystemResourceUpdateInternal /// The updatable properties of the FileSystemResource. Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateProperties Property { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags Tag { get; set; } /// User Details Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserDetails UserDetail { get; set; } /// User Email diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.json.cs index 425ee273897..7c6e7697a0b 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdate.json.cs @@ -65,7 +65,7 @@ internal FileSystemResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runt } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.PowerShell.cs similarity index 80% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.PowerShell.cs index 5b4a7b46cba..08d818f9fba 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models { using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(FileSystemResourceUpdateTagsTypeConverter))] + public partial class FileSystemResourceUpdateTags { /// @@ -61,61 +61,37 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new FileSystemResourceUpdateTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new FileSystemResourceUpdateTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - - /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal FileSystemResourceUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +106,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal FileSystemResourceUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -147,10 +123,34 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co CopyFrom(content); AfterDeserializePSObject(content); } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(FileSystemResourceUpdateTagsTypeConverter))] + public partial interface IFileSystemResourceUpdateTags { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.TypeConverter.cs similarity index 83% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.TypeConverter.cs index 8944ed0f08f..f475ed117ba 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class FileSystemResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return FileSystemResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIden } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return FileSystemResourceUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return FileSystemResourceUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.cs new file mode 100644 index 00000000000..ed3945fc3d8 --- /dev/null +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; + + /// Resource tags. + public partial class FileSystemResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTagsInternal + { + + /// Creates an new instance. + public FileSystemResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IFileSystemResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IFileSystemResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..40158f23dd3 --- /dev/null +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; + + public partial class FileSystemResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.FileSystemResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.json.cs new file mode 100644 index 00000000000..bd1fcb77d3a --- /dev/null +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/FileSystemResourceUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; + + /// Resource tags. + public partial class FileSystemResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject instance to deserialize from. + /// + internal FileSystemResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IFileSystemResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json ? new FileSystemResourceUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index d28e6a810cc..c7e94a2cbda 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -121,7 +121,7 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -154,7 +154,7 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.cs index 8da940a4bb0..66f9fdbe4c4 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.cs @@ -43,11 +43,11 @@ public partial class ManagedServiceIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -106,8 +106,8 @@ public partial interface IManagedServiceIdentity : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,7 +126,7 @@ internal partial interface IManagedServiceIdentityInternal [global::Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs index f8625a9fc9c..ff5e39f29b5 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentity.json.cs @@ -78,7 +78,7 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtim {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..0310c880cd5 --- /dev/null +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..65c6bd261c2 --- /dev/null +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 57% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs index f7f3b579410..ea44ef1a197 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentitiesInternal + public partial class ManagedServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface IManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs index bf45deb43dd..8ef28a65904 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class ManagedServiceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ManagedServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs index 2f8291701c7..2e21a8901ed 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/ManagedServiceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class ManagedServiceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IManagedServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode ToJson(Mi AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 2feb063f3f3..2e46b64cd2f 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.cs index af41702e573..8c7336cce81 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Origin(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.json.cs index b8f2b6649d8..e6fcbe1965a 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json. return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 83% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index 6d10505608b..263d7e7f6d6 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 84f0e1851ee..454c094e205 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags ConvertFrom } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 60% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.cs index 8693931b4bc..4a421f35b21 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 81083a68585..286c23dd910 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.json.cs index cb3e2f7394a..331a9a45a37 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models using static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonNode ToJson(Mi AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateExpanded.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateExpanded.cs index 76832b7f1f5..ea8870b6e93 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateExpanded.cs @@ -318,8 +318,8 @@ public partial class NewAzQumuloFileSystem_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateViaIdentityExpanded.cs index f8582c51b3d..c1804bbd9ec 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/NewAzQumuloFileSystem_CreateViaIdentityExpanded.cs @@ -278,8 +278,8 @@ public partial class NewAzQumuloFileSystem_CreateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/SetAzQumuloFileSystem_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/SetAzQumuloFileSystem_UpdateExpanded.cs index 8b9c408c5f2..260eb1264d6 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/SetAzQumuloFileSystem_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/SetAzQumuloFileSystem_UpdateExpanded.cs @@ -319,8 +319,8 @@ public partial class SetAzQumuloFileSystem_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateExpanded.cs index 59a5ee55cd9..f1a6038d993 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateExpanded.cs @@ -307,8 +307,8 @@ public partial class UpdateAzQumuloFileSystem_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -680,7 +680,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageSku"))) { diff --git a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateViaIdentityExpanded.cs index 0dfa2b10a23..c4aaaefc581 100644 --- a/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Qumulo.Storage.Management/target/generated/cmdlets/UpdateAzQumuloFileSystem_UpdateViaIdentityExpanded.cs @@ -267,8 +267,8 @@ public partial class UpdateAzQumuloFileSystem_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -660,7 +660,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.Qumulo.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageSku"))) { diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.PowerShell.cs index d3f9ede0865..a8ea3505e83 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.PowerShell.cs @@ -124,7 +124,7 @@ internal Catalog(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -205,7 +205,7 @@ internal Catalog(global::System.Management.Automation.PSObject content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.cs index 72a83d72c8f..554459d6e03 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Catalog.cs @@ -123,7 +123,7 @@ public partial class Catalog : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Origin(Microsoft.Azure.PowerShell.Cmdlets.Sphere.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// The Azure Sphere tenant ID associated with the catalog. [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Origin(Microsoft.Azure.PowerShell.Cmdlets.Sphere.PropertyOrigin.Inlined)] diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.PowerShell.cs index 63fece22120..9245c477167 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.PowerShell.cs @@ -76,7 +76,7 @@ internal CatalogUpdate(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -97,7 +97,7 @@ internal CatalogUpdate(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.cs index c7630a9bf0c..6595543aefb 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.cs @@ -12,11 +12,11 @@ public partial class CatalogUpdate : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Origin(Microsoft.Azure.PowerShell.Cmdlets.Sphere.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTags()); set => this._tag = value; } /// Creates an new instance. public CatalogUpdate() @@ -37,8 +37,8 @@ public partial interface ICatalogUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags Tag { get; set; } } /// The type used for update operations of the Catalog. @@ -46,7 +46,7 @@ internal partial interface ICatalogUpdateInternal { /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.json.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.json.cs index 8518c3ce174..0104af38142 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.json.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdate.json.cs @@ -63,7 +63,7 @@ internal CatalogUpdate(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.Js { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.PowerShell.cs similarity index 83% rename from tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.PowerShell.cs index 0e7af36df36..9d3f3323c78 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models using Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(CatalogUpdateTagsTypeConverter))] + public partial class CatalogUpdateTags { /// @@ -61,44 +61,11 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Tags(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Tags(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal CatalogUpdateTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +80,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal CatalogUpdateTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -131,6 +98,39 @@ internal Tags(global::System.Management.Automation.PSObject content) AfterDeserializePSObject(content); } + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CatalogUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CatalogUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode.Parse(jsonText)); + /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. @@ -149,8 +149,8 @@ public override string ToString() } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(CatalogUpdateTagsTypeConverter))] + public partial interface ICatalogUpdateTags { diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.TypeConverter.cs index 2bd574fa09a..6f0cd52a758 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models using Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class CatalogUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return CatalogUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags ConvertFrom } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return CatalogUpdateTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return CatalogUpdateTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.cs similarity index 61% rename from tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.cs index bad06bb1f43..fc455391295 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITagsInternal + public partial class CatalogUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public CatalogUpdateTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ICatalogUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ICatalogUpdateTagsInternal { diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.dictionary.cs index eed9dbd763d..707b9ce107e 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; - public partial class Tags : + public partial class CatalogUpdateTags : Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.CatalogUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.json.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.json.cs new file mode 100644 index 00000000000..55d8532ff1f --- /dev/null +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/CatalogUpdateTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; + + /// Resource tags. + public partial class CatalogUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject instance to deserialize from. + /// + internal CatalogUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json ? new CatalogUpdateTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Deployment.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Deployment.PowerShell.cs index 524d0b83abb..dc7dba0450a 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Deployment.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Deployment.PowerShell.cs @@ -122,10 +122,6 @@ internal Deployment(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("DeployedImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage = (System.Collections.Generic.List) content.GetValueForProperty("DeployedImage",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -134,6 +130,10 @@ internal Deployment(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeploymentId = (string) content.GetValueForProperty("DeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeploymentId, global::System.Convert.ToString); } + if (content.Contains("DeployedImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage = (System.Collections.Generic.List) content.GetValueForProperty("DeployedImage",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageTypeConverter.ConvertFrom)); + } if (content.Contains("DateUtc")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DateUtc = (global::System.DateTime?) content.GetValueForProperty("DateUtc",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DateUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); @@ -203,10 +203,6 @@ internal Deployment(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } - if (content.Contains("DeployedImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage = (System.Collections.Generic.List) content.GetValueForProperty("DeployedImage",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageTypeConverter.ConvertFrom)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -215,6 +211,10 @@ internal Deployment(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeploymentId = (string) content.GetValueForProperty("DeploymentId",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeploymentId, global::System.Convert.ToString); } + if (content.Contains("DeployedImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage = (System.Collections.Generic.List) content.GetValueForProperty("DeployedImage",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DeployedImage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ImageTypeConverter.ConvertFrom)); + } if (content.Contains("DateUtc")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DateUtc = (global::System.DateTime?) content.GetValueForProperty("DateUtc",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IDeploymentInternal)this).DateUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 4c6e6ce7312..d7e48f4d479 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 87c7fe0e53e..b15d9bec68b 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.cs index 7e5834ea0b9..9b3c94d0686 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Sphere.Origin(Microsoft.Azure.PowerShell.Cmdlets.Sphere.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.json.cs index 84a9a269c5e..236b2e4f5a5 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json. return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs new file mode 100644 index 00000000000..0f5220ee493 --- /dev/null +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 00000000000..c26c9e5aaa1 --- /dev/null +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 00000000000..a0bf07e4893 --- /dev/null +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 00000000000..4034b383c53 --- /dev/null +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.json.cs index e3050df2641..c184cd1db75 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models using static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonNode ToJson(Mi AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Sphere.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/NewAzSphereCatalog_CreateExpanded.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/NewAzSphereCatalog_CreateExpanded.cs index ea5254d3d9c..e4cd63c6aca 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/NewAzSphereCatalog_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/NewAzSphereCatalog_CreateExpanded.cs @@ -190,8 +190,8 @@ public partial class NewAzSphereCatalog_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/SetAzSphereCatalog_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/SetAzSphereCatalog_UpdateExpanded.cs index cb86e5b75bf..122e75c463a 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/SetAzSphereCatalog_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/SetAzSphereCatalog_UpdateExpanded.cs @@ -191,8 +191,8 @@ public partial class SetAzSphereCatalog_UpdateExpanded : global::System.Manageme ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateExpanded.cs index 3ab1de9dd04..e6a5fc71044 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateExpanded.cs @@ -175,8 +175,8 @@ public partial class UpdateAzSphereCatalog_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateViaIdentityExpanded.cs index ea26d85abc9..906f13b06f4 100644 --- a/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Sphere.Management/target/generated/cmdlets/UpdateAzSphereCatalog_UpdateViaIdentityExpanded.cs @@ -135,8 +135,8 @@ public partial class UpdateAzSphereCatalog_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Sphere.Models.ICatalogUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index 0cd86f7ae87..a4545a49101 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.PowerShell.cs index 9d9d581bfe7..1f980cfc76a 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.PowerShell.cs @@ -159,16 +159,12 @@ internal StandbyContainerGroupPoolResource(global::System.Collections.IDictionar } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -181,6 +177,10 @@ internal StandbyContainerGroupPoolResource(global::System.Collections.IDictionar { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ContainerGroupProperty = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IContainerGroupProperties) content.GetValueForProperty("ContainerGroupProperty",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ContainerGroupProperty, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ContainerGroupPropertiesTypeConverter.ConvertFrom); } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ElasticityProfileRefillPolicy")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ElasticityProfileRefillPolicy = (string) content.GetValueForProperty("ElasticityProfileRefillPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ElasticityProfileRefillPolicy, global::System.Convert.ToString); @@ -272,16 +272,12 @@ internal StandbyContainerGroupPoolResource(global::System.Management.Automation. } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } if (content.Contains("ProvisioningState")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ProvisioningState, global::System.Convert.ToString); @@ -294,6 +290,10 @@ internal StandbyContainerGroupPoolResource(global::System.Management.Automation. { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ContainerGroupProperty = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IContainerGroupProperties) content.GetValueForProperty("ContainerGroupProperty",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ContainerGroupProperty, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ContainerGroupPropertiesTypeConverter.ConvertFrom); } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ElasticityProfileRefillPolicy")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ElasticityProfileRefillPolicy = (string) content.GetValueForProperty("ElasticityProfileRefillPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceInternal)this).ElasticityProfileRefillPolicy, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.cs index af6e52d42ea..21aea3699ab 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResource.cs @@ -150,7 +150,7 @@ public partial class StandbyContainerGroupPoolResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.PowerShell.cs index f79e980431e..f3dc3243e58 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.PowerShell.cs @@ -118,11 +118,7 @@ internal StandbyContainerGroupPoolResourceUpdate(global::System.Collections.IDic } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ElasticityProfile")) { @@ -132,6 +128,10 @@ internal StandbyContainerGroupPoolResourceUpdate(global::System.Collections.IDic { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ContainerGroupProperty = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IContainerGroupProperties) content.GetValueForProperty("ContainerGroupProperty",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ContainerGroupProperty, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ContainerGroupPropertiesTypeConverter.ConvertFrom); } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ElasticityProfileRefillPolicy")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ElasticityProfileRefillPolicy = (string) content.GetValueForProperty("ElasticityProfileRefillPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ElasticityProfileRefillPolicy, global::System.Convert.ToString); @@ -179,11 +179,7 @@ internal StandbyContainerGroupPoolResourceUpdate(global::System.Management.Autom } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); - } - if (content.Contains("Zone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ElasticityProfile")) { @@ -193,6 +189,10 @@ internal StandbyContainerGroupPoolResourceUpdate(global::System.Management.Autom { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ContainerGroupProperty = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IContainerGroupProperties) content.GetValueForProperty("ContainerGroupProperty",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ContainerGroupProperty, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ContainerGroupPropertiesTypeConverter.ConvertFrom); } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } if (content.Contains("ElasticityProfileRefillPolicy")) { ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ElasticityProfileRefillPolicy = (string) content.GetValueForProperty("ElasticityProfileRefillPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateInternal)this).ElasticityProfileRefillPolicy, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.cs index 53e2724b78f..6437b0eb562 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.cs @@ -51,11 +51,11 @@ public partial class StandbyContainerGroupPoolResourceUpdate : internal Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateTags()); set => this._tag = value; } /// Specifies zones of standby container group pools. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Inlined)] @@ -136,8 +136,8 @@ public partial interface IStandbyContainerGroupPoolResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags Tag { get; set; } /// Specifies zones of standby container group pools. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Info( Required = false, @@ -175,7 +175,7 @@ internal partial interface IStandbyContainerGroupPoolResourceUpdateInternal /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateProperties Property { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags Tag { get; set; } /// Specifies zones of standby container group pools. System.Collections.Generic.List Zone { get; set; } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.json.cs index f134976ef67..7c6b75a9cc9 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdate.json.cs @@ -76,7 +76,7 @@ internal StandbyContainerGroupPoolResourceUpdate(Microsoft.Azure.PowerShell.Cmdl return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.PowerShell.cs new file mode 100644 index 00000000000..4d4788a30a5 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(StandbyContainerGroupPoolResourceUpdateTagsTypeConverter))] + public partial class StandbyContainerGroupPoolResourceUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StandbyContainerGroupPoolResourceUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StandbyContainerGroupPoolResourceUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StandbyContainerGroupPoolResourceUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StandbyContainerGroupPoolResourceUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(StandbyContainerGroupPoolResourceUpdateTagsTypeConverter))] + public partial interface IStandbyContainerGroupPoolResourceUpdateTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.TypeConverter.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.TypeConverter.cs new file mode 100644 index 00000000000..9d8d0534e60 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StandbyContainerGroupPoolResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StandbyContainerGroupPoolResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StandbyContainerGroupPoolResourceUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StandbyContainerGroupPoolResourceUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.cs new file mode 100644 index 00000000000..733d9a92904 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + /// Resource tags. + public partial class StandbyContainerGroupPoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTagsInternal + { + + /// + /// Creates an new instance. + /// + public StandbyContainerGroupPoolResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IStandbyContainerGroupPoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IStandbyContainerGroupPoolResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..6f2a27e6b50 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + public partial class StandbyContainerGroupPoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyContainerGroupPoolResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.json.cs new file mode 100644 index 00000000000..1a1d4f175b6 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyContainerGroupPoolResourceUpdateTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + /// Resource tags. + public partial class StandbyContainerGroupPoolResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json ? new StandbyContainerGroupPoolResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject instance to deserialize from. + /// + internal StandbyContainerGroupPoolResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.PowerShell.cs index 9507afc0d38..c2500d798fd 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.PowerShell.cs @@ -159,7 +159,7 @@ internal StandbyVirtualMachinePoolResource(global::System.Collections.IDictionar } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -256,7 +256,7 @@ internal StandbyVirtualMachinePoolResource(global::System.Management.Automation. } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.cs index 8421025f5af..a879ef50076 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResource.cs @@ -143,7 +143,7 @@ public partial class StandbyVirtualMachinePoolResource : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.PowerShell.cs index 5b846ebd092..f387993d61c 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.PowerShell.cs @@ -118,7 +118,7 @@ internal StandbyVirtualMachinePoolResourceUpdate(global::System.Collections.IDic } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ElasticityProfile")) { @@ -163,7 +163,7 @@ internal StandbyVirtualMachinePoolResourceUpdate(global::System.Management.Autom } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateTagsTypeConverter.ConvertFrom); } if (content.Contains("ElasticityProfile")) { diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.cs index c29ad70e82f..d94fe1c3045 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.cs @@ -44,11 +44,11 @@ public partial class StandbyVirtualMachinePoolResourceUpdate : internal Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateTags()); set => this._tag = value; } /// Specifies the desired state of virtual machines in the pool. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Inlined)] @@ -113,8 +113,8 @@ public partial interface IStandbyVirtualMachinePoolResourceUpdate : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags Tag { get; set; } /// Specifies the desired state of virtual machines in the pool. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Info( Required = false, @@ -151,7 +151,7 @@ internal partial interface IStandbyVirtualMachinePoolResourceUpdateInternal /// The resource-specific properties for this resource. Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateProperties Property { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags Tag { get; set; } /// Specifies the desired state of virtual machines in the pool. [global::Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PSArgumentCompleterAttribute("Running", "Deallocated", "Hibernated")] string VirtualMachineState { get; set; } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.json.cs index 28ecaeecace..5e290600329 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.json.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdate.json.cs @@ -76,7 +76,7 @@ internal StandbyVirtualMachinePoolResourceUpdate(Microsoft.Azure.PowerShell.Cmdl return; } {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.PowerShell.cs new file mode 100644 index 00000000000..4dfe23ae0db --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(StandbyVirtualMachinePoolResourceUpdateTagsTypeConverter))] + public partial class StandbyVirtualMachinePoolResourceUpdateTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StandbyVirtualMachinePoolResourceUpdateTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StandbyVirtualMachinePoolResourceUpdateTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StandbyVirtualMachinePoolResourceUpdateTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StandbyVirtualMachinePoolResourceUpdateTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(StandbyVirtualMachinePoolResourceUpdateTagsTypeConverter))] + public partial interface IStandbyVirtualMachinePoolResourceUpdateTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.TypeConverter.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.TypeConverter.cs new file mode 100644 index 00000000000..f46aedad161 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StandbyVirtualMachinePoolResourceUpdateTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StandbyVirtualMachinePoolResourceUpdateTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StandbyVirtualMachinePoolResourceUpdateTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StandbyVirtualMachinePoolResourceUpdateTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.cs new file mode 100644 index 00000000000..c761bf5a711 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + /// Resource tags. + public partial class StandbyVirtualMachinePoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTagsInternal + { + + /// + /// Creates an new instance. + /// + public StandbyVirtualMachinePoolResourceUpdateTags() + { + + } + } + /// Resource tags. + public partial interface IStandbyVirtualMachinePoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IStandbyVirtualMachinePoolResourceUpdateTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.dictionary.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.dictionary.cs new file mode 100644 index 00000000000..ae4d0811948 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + public partial class StandbyVirtualMachinePoolResourceUpdateTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.StandbyVirtualMachinePoolResourceUpdateTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.json.cs new file mode 100644 index 00000000000..32e49bbe216 --- /dev/null +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/StandbyVirtualMachinePoolResourceUpdateTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; + + /// Resource tags. + public partial class StandbyVirtualMachinePoolResourceUpdateTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json ? new StandbyVirtualMachinePoolResourceUpdateTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject instance to deserialize from. + /// + internal StandbyVirtualMachinePoolResourceUpdateTags(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 497b2ae9fb1..33221f6d713 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.cs index a82d23afd5f..a85638f9680 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.cs @@ -96,11 +96,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Origin(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -151,8 +151,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -162,7 +162,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.json.cs index 31469074bc8..16c128a1c7a 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime. return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 82% rename from tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index f7ef118f3fd..751763d0f74 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 84% rename from tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.TypeConverter.cs rename to tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 59ccf3d1602..7e45e8b66c7 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models using Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,12 +24,13 @@ public partial class TagsTypeConverter : global::System.Management.Automation.PS public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -92,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -124,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Conver } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return Tags.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return Tags.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.cs index fcbd98900c2..724bc7c1c13 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index 73e76023e5e..7655df13701 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models { using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.json.cs index abbdf6313ea..6871b05866f 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models using static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,40 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags. /// /// a to deserialize from. - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags. - public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json ? new Tags(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode node) { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); + return node is Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.SerializationMode serializationMode) { @@ -101,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonNode ToJs AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateExpanded.cs index cc0f1f89380..64b5a656d2e 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateExpanded.cs @@ -247,8 +247,8 @@ public partial class NewAzStandbyPoolStandbyContainerGroupPool_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies zones of standby container group pools. [global::System.Management.Automation.AllowEmptyCollection] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateViaIdentityExpanded.cs index fe84fcd9e08..b975a237729 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyContainerGroupPool_CreateViaIdentityExpanded.cs @@ -207,8 +207,8 @@ public partial class NewAzStandbyPoolStandbyContainerGroupPool_CreateViaIdentity ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies zones of standby container group pools. [global::System.Management.Automation.AllowEmptyCollection] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateExpanded.cs index e680ee01ad8..e048a2d00a5 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateExpanded.cs @@ -230,8 +230,8 @@ public partial class NewAzStandbyPoolStandbyVirtualMachinePool_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies the desired state of virtual machines in the pool. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the desired state of virtual machines in the pool.")] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateViaIdentityExpanded.cs index 0f0d6c044e3..62a94573cf6 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/NewAzStandbyPoolStandbyVirtualMachinePool_CreateViaIdentityExpanded.cs @@ -190,8 +190,8 @@ public partial class NewAzStandbyPoolStandbyVirtualMachinePool_CreateViaIdentity ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies the desired state of virtual machines in the pool. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the desired state of virtual machines in the pool.")] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs index 1043d198af3..ea99620db5e 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs @@ -248,8 +248,8 @@ public partial class SetAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies zones of standby container group pools. [global::System.Management.Automation.AllowEmptyCollection] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs index c93ea08b2be..68ebcbe76a6 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/SetAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs @@ -231,8 +231,8 @@ public partial class SetAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// Specifies the desired state of virtual machines in the pool. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the desired state of virtual machines in the pool.")] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs index 943ce2c1c92..c8c20a6cde2 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded.cs @@ -232,8 +232,8 @@ public partial class UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Specifies zones of standby container group pools. [global::System.Management.Automation.AllowEmptyCollection] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateViaIdentityExpanded.cs index edbfb5615d9..3153fb902be 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateViaIdentityExpanded.cs @@ -192,8 +192,8 @@ public partial class UpdateAzStandbyPoolStandbyContainerGroupPool_UpdateViaIdent ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyContainerGroupPoolResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Specifies zones of standby container group pools. [global::System.Management.Automation.AllowEmptyCollection] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs index 241e2232223..58892d33a41 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded.cs @@ -215,8 +215,8 @@ public partial class UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Specifies the desired state of virtual machines in the pool. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the desired state of virtual machines in the pool.")] diff --git a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateViaIdentityExpanded.cs index 0f100319a8c..178d5d30d21 100644 --- a/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/StandbyPool.Management/target/generated/cmdlets/UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateViaIdentityExpanded.cs @@ -175,8 +175,8 @@ public partial class UpdateAzStandbyPoolStandbyVirtualMachinePool_UpdateViaIdent ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StandbyPool.Models.IStandbyVirtualMachinePoolResourceUpdateTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// Specifies the desired state of virtual machines in the pool. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the desired state of virtual machines in the pool.")] diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.PowerShell.cs index d04a2b0cd26..0ac85990589 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.PowerShell.cs @@ -116,7 +116,7 @@ internal DatabaseConfiguration(global::System.Collections.IDictionary content) } if (content.Contains("DiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("ImageReferencePublisher")) { @@ -205,7 +205,7 @@ internal DatabaseConfiguration(global::System.Management.Automation.PSObject con } if (content.Contains("DiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("ImageReferencePublisher")) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.cs index 4032966a351..0a74deac2b0 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DatabaseConfiguration.cs @@ -30,7 +30,7 @@ public partial class DatabaseConfiguration : /// 'os'], Optional volume : ['backup']. /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DiskConfiguration).DiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DiskConfiguration).DiskVolumeConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DiskConfiguration).DiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DiskConfiguration).DiskVolumeConfiguration = value ?? null /* model class */; } /// /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to @@ -168,8 +168,8 @@ public partial interface IDatabaseConfiguration : Update = true, Description = @"The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup'].", SerializedName = @"diskVolumeConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } /// /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to /// provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. @@ -333,7 +333,7 @@ internal partial interface IDatabaseConfigurationInternal /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } /// /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to /// provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.PowerShell.cs index 6f221068ad0..cefc47f64d7 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.PowerShell.cs @@ -102,7 +102,7 @@ internal DiskConfiguration(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -123,7 +123,7 @@ internal DiskConfiguration(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("DiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)this).DiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.cs index df4bbf4f553..5c7ebf5a52a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.cs @@ -12,14 +12,14 @@ public partial class DiskConfiguration : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations _diskVolumeConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations _diskVolumeConfiguration; /// /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskVolumeConfiguration { get => (this._diskVolumeConfiguration = this._diskVolumeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurations()); set => this._diskVolumeConfiguration = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskVolumeConfiguration { get => (this._diskVolumeConfiguration = this._diskVolumeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurations()); set => this._diskVolumeConfiguration = value; } /// Creates an new instance. public DiskConfiguration() @@ -43,8 +43,8 @@ public partial interface IDiskConfiguration : Update = true, Description = @"The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup'].", SerializedName = @"diskVolumeConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskVolumeConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskVolumeConfiguration { get; set; } } /// The Disk Configuration Details. @@ -55,7 +55,7 @@ internal partial interface IDiskConfigurationInternal /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskVolumeConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskVolumeConfiguration { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.json.cs index e79affc04f0..eda46e8db56 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfiguration.json.cs @@ -63,7 +63,7 @@ internal DiskConfiguration(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance { return; } - {_diskVolumeConfiguration = If( json?.PropertyT("diskVolumeConfigurations"), out var __jsonDiskVolumeConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurations.FromJson(__jsonDiskVolumeConfigurations) : _diskVolumeConfiguration;} + {_diskVolumeConfiguration = If( json?.PropertyT("diskVolumeConfigurations"), out var __jsonDiskVolumeConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurations.FromJson(__jsonDiskVolumeConfigurations) : _diskVolumeConfiguration;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.PowerShell.cs similarity index 78% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.PowerShell.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.PowerShell.cs index e5e39baf95a..3c47e1c57ad 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.PowerShell.cs @@ -9,8 +9,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - [System.ComponentModel.TypeConverter(typeof(DiskVolumeConfigurationsTypeConverter))] - public partial class DiskVolumeConfigurations + [System.ComponentModel.TypeConverter(typeof(DiskConfigurationDiskVolumeConfigurationsTypeConverter))] + public partial class DiskConfigurationDiskVolumeConfigurations { /// @@ -64,37 +64,39 @@ public partial class DiskVolumeConfigurations partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new DiskVolumeConfigurations(content); + return new DiskConfigurationDiskVolumeConfigurations(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new DiskVolumeConfigurations(content); + return new DiskConfigurationDiskVolumeConfigurations(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal DiskVolumeConfigurations(global::System.Collections.IDictionary content) + internal DiskConfigurationDiskVolumeConfigurations(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -109,11 +111,11 @@ internal DiskVolumeConfigurations(global::System.Collections.IDictionary content } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal DiskVolumeConfigurations(global::System.Management.Automation.PSObject content) + internal DiskConfigurationDiskVolumeConfigurations(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -128,11 +130,14 @@ internal DiskVolumeConfigurations(global::System.Management.Automation.PSObject } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json + /// string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -153,8 +158,8 @@ public override string ToString() } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - [System.ComponentModel.TypeConverter(typeof(DiskVolumeConfigurationsTypeConverter))] - public partial interface IDiskVolumeConfigurations + [System.ComponentModel.TypeConverter(typeof(DiskConfigurationDiskVolumeConfigurationsTypeConverter))] + public partial interface IDiskConfigurationDiskVolumeConfigurations { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.TypeConverter.cs new file mode 100644 index 00000000000..fff0e454fd1 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiskConfigurationDiskVolumeConfigurationsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiskConfigurationDiskVolumeConfigurations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiskConfigurationDiskVolumeConfigurations.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiskConfigurationDiskVolumeConfigurations.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.cs similarity index 73% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.cs index 402cacaf1ca..795cf2c0edc 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.cs @@ -9,20 +9,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - public partial class DiskVolumeConfigurations : - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations, - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurationsInternal + public partial class DiskConfigurationDiskVolumeConfigurations : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurationsInternal { - /// Creates an new instance. - public DiskVolumeConfigurations() + /// + /// Creates an new instance. + /// + public DiskConfigurationDiskVolumeConfigurations() { } } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - public partial interface IDiskVolumeConfigurations : + public partial interface IDiskConfigurationDiskVolumeConfigurations : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { @@ -30,7 +32,7 @@ public partial interface IDiskVolumeConfigurations : } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - internal partial interface IDiskVolumeConfigurationsInternal + internal partial interface IDiskConfigurationDiskVolumeConfigurationsInternal { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.dictionary.cs similarity index 97% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.dictionary.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.dictionary.cs index 33c210f38d1..1c290baf9e6 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.dictionary.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; - public partial class DiskVolumeConfigurations : + public partial class DiskConfigurationDiskVolumeConfigurations : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurations source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurations source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.json.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.json.cs index 06ed5064486..356b452aa09 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskConfigurationDiskVolumeConfigurations.json.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - public partial class DiskVolumeConfigurations + public partial class DiskConfigurationDiskVolumeConfigurations { /// @@ -55,11 +55,11 @@ public partial class DiskVolumeConfigurations partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. /// - internal DiskVolumeConfigurations(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + internal DiskConfigurationDiskVolumeConfigurations(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -72,25 +72,27 @@ internal DiskVolumeConfigurations(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualI } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new DiskVolumeConfigurations(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new DiskConfigurationDiskVolumeConfigurations(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs index acf664ee2d0..75070d0f6f6 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ErrorResponse.PowerShell.cs @@ -106,14 +106,6 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -126,6 +118,14 @@ internal ErrorResponse(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -147,14 +147,6 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); @@ -167,6 +159,14 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs index 5113f42a607..857f267e004 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/OperationStatusResult.PowerShell.cs @@ -143,14 +143,6 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -163,6 +155,14 @@ internal OperationStatusResult(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -216,14 +216,6 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); @@ -236,6 +228,14 @@ internal OperationStatusResult(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.PowerShell.cs index 86ff66bd5cf..ba32c57a6f0 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.PowerShell.cs @@ -163,16 +163,12 @@ internal SapApplicationServerInstance(global::System.Collections.IDictionary con } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ApplicationServerVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("LoadBalancerDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).LoadBalancerDetail = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerDetails) content.GetValueForProperty("LoadBalancerDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).LoadBalancerDetail, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerDetailsTypeConverter.ConvertFrom); @@ -221,6 +217,10 @@ internal SapApplicationServerInstance(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).DispatcherStatus = (string) content.GetValueForProperty("DispatcherStatus",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).DispatcherStatus, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ApplicationServerVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Status, global::System.Convert.ToString); @@ -241,10 +241,6 @@ internal SapApplicationServerInstance(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Code, global::System.Convert.ToString); @@ -253,6 +249,10 @@ internal SapApplicationServerInstance(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -324,16 +324,12 @@ internal SapApplicationServerInstance(global::System.Management.Automation.PSObj } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ApplicationServerVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("LoadBalancerDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).LoadBalancerDetail = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerDetails) content.GetValueForProperty("LoadBalancerDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).LoadBalancerDetail, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerDetailsTypeConverter.ConvertFrom); @@ -382,6 +378,10 @@ internal SapApplicationServerInstance(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).DispatcherStatus = (string) content.GetValueForProperty("DispatcherStatus",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).DispatcherStatus, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ApplicationServerVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Status, global::System.Convert.ToString); @@ -402,10 +402,6 @@ internal SapApplicationServerInstance(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Code, global::System.Convert.ToString); @@ -414,6 +410,10 @@ internal SapApplicationServerInstance(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.cs index c3e1ddced83..d607f1ef8fc 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerInstance.cs @@ -253,7 +253,7 @@ public partial class SapApplicationServerInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerProperties.PowerShell.cs index 86405271bfd..12068fb4126 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapApplicationServerProperties.PowerShell.cs @@ -181,10 +181,6 @@ internal SapApplicationServerProperties(global::System.Collections.IDictionary c { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Code, global::System.Convert.ToString); @@ -193,6 +189,10 @@ internal SapApplicationServerProperties(global::System.Collections.IDictionary c { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -282,10 +282,6 @@ internal SapApplicationServerProperties(global::System.Management.Automation.PSO { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Code, global::System.Convert.ToString); @@ -294,6 +290,10 @@ internal SapApplicationServerProperties(global::System.Management.Automation.PSO { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapApplicationServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.PowerShell.cs index aecd9c1efcb..53f8c12eb32 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.PowerShell.cs @@ -161,16 +161,12 @@ internal SapCentralServerInstance(global::System.Collections.IDictionary content } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.CentralServerVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("MessageServerProperty")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).MessageServerProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IMessageServerProperties) content.GetValueForProperty("MessageServerProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).MessageServerProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.MessageServerPropertiesTypeConverter.ConvertFrom); @@ -211,6 +207,10 @@ internal SapCentralServerInstance(global::System.Collections.IDictionary content { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).KernelPatch = (string) content.GetValueForProperty("KernelPatch",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).KernelPatch, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.CentralServerVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Status, global::System.Convert.ToString); @@ -311,10 +311,6 @@ internal SapCentralServerInstance(global::System.Collections.IDictionary content { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Code, global::System.Convert.ToString); @@ -323,6 +319,10 @@ internal SapCentralServerInstance(global::System.Collections.IDictionary content { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -394,16 +394,12 @@ internal SapCentralServerInstance(global::System.Management.Automation.PSObject } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.CentralServerVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("MessageServerProperty")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).MessageServerProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IMessageServerProperties) content.GetValueForProperty("MessageServerProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).MessageServerProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.MessageServerPropertiesTypeConverter.ConvertFrom); @@ -444,6 +440,10 @@ internal SapCentralServerInstance(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).KernelPatch = (string) content.GetValueForProperty("KernelPatch",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).KernelPatch, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.CentralServerVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Status, global::System.Convert.ToString); @@ -544,10 +544,6 @@ internal SapCentralServerInstance(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Code, global::System.Convert.ToString); @@ -556,6 +552,10 @@ internal SapCentralServerInstance(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.cs index 8d0d70c4be0..556ac058662 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerInstance.cs @@ -363,7 +363,7 @@ public partial class SapCentralServerInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerProperties.PowerShell.cs index fb5f9205933..84f8f2ea348 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapCentralServerProperties.PowerShell.cs @@ -251,10 +251,6 @@ internal SapCentralServerProperties(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Code, global::System.Convert.ToString); @@ -263,6 +259,10 @@ internal SapCentralServerProperties(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -424,10 +424,6 @@ internal SapCentralServerProperties(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Code, global::System.Convert.ToString); @@ -436,6 +432,10 @@ internal SapCentralServerProperties(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapCentralServerPropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.PowerShell.cs index c9ffcf0181b..b7f0de1390a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.PowerShell.cs @@ -161,16 +161,12 @@ internal SapDatabaseInstance(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DatabaseVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("LoadBalancerDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).LoadBalancerDetail = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerDetails) content.GetValueForProperty("LoadBalancerDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).LoadBalancerDetail, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerDetailsTypeConverter.ConvertFrom); @@ -195,6 +191,10 @@ internal SapDatabaseInstance(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).IPAddress, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DatabaseVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Status, global::System.Convert.ToString); @@ -211,10 +211,6 @@ internal SapDatabaseInstance(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Code, global::System.Convert.ToString); @@ -223,6 +219,10 @@ internal SapDatabaseInstance(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -294,16 +294,12 @@ internal SapDatabaseInstance(global::System.Management.Automation.PSObject conte } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } - if (content.Contains("VMDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DatabaseVMDetailsTypeConverter.ConvertFrom)); - } if (content.Contains("LoadBalancerDetail")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).LoadBalancerDetail = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerDetails) content.GetValueForProperty("LoadBalancerDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).LoadBalancerDetail, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerDetailsTypeConverter.ConvertFrom); @@ -328,6 +324,10 @@ internal SapDatabaseInstance(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).IPAddress, global::System.Convert.ToString); } + if (content.Contains("VMDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail = (System.Collections.Generic.List) content.GetValueForProperty("VMDetail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).VMDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DatabaseVMDetailsTypeConverter.ConvertFrom)); + } if (content.Contains("Status")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Status, global::System.Convert.ToString); @@ -344,10 +344,6 @@ internal SapDatabaseInstance(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Code, global::System.Convert.ToString); @@ -356,6 +352,10 @@ internal SapDatabaseInstance(global::System.Management.Automation.PSObject conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabaseInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.cs index 40b79dbdd61..750822c9743 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseInstance.cs @@ -206,7 +206,7 @@ public partial class SapDatabaseInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseProperties.PowerShell.cs index 3774eaa585d..e68050590cc 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDatabaseProperties.PowerShell.cs @@ -151,10 +151,6 @@ internal SapDatabaseProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Code, global::System.Convert.ToString); @@ -163,6 +159,10 @@ internal SapDatabaseProperties(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -224,10 +224,6 @@ internal SapDatabaseProperties(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Code, global::System.Convert.ToString); @@ -236,6 +232,10 @@ internal SapDatabaseProperties(global::System.Management.Automation.PSObject con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDatabasePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.PowerShell.cs index da4d00a5ded..e97549641cd 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.PowerShell.cs @@ -109,7 +109,7 @@ internal SapDiskConfigurationsResult(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("VolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations) content.GetValueForProperty("VolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations) content.GetValueForProperty("VolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfigurationsResultVolumeConfigurationsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -130,7 +130,7 @@ internal SapDiskConfigurationsResult(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("VolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations) content.GetValueForProperty("VolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations) content.GetValueForProperty("VolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultInternal)this).VolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfigurationsResultVolumeConfigurationsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.cs index 2533880ba4c..c1db576890e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.cs @@ -12,14 +12,14 @@ public partial class SapDiskConfigurationsResult : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations _volumeConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations _volumeConfiguration; /// /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations VolumeConfiguration { get => (this._volumeConfiguration = this._volumeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VolumeConfigurations()); set => this._volumeConfiguration = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations VolumeConfiguration { get => (this._volumeConfiguration = this._volumeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfigurationsResultVolumeConfigurations()); set => this._volumeConfiguration = value; } /// Creates an new instance. public SapDiskConfigurationsResult() @@ -43,8 +43,8 @@ public partial interface ISapDiskConfigurationsResult : Update = true, Description = @"The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup'].", SerializedName = @"volumeConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations VolumeConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations VolumeConfiguration { get; set; } } /// The list of disk configuration for vmSku which are part of SAP deployment. @@ -55,7 +55,7 @@ internal partial interface ISapDiskConfigurationsResultInternal /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations VolumeConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations VolumeConfiguration { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.json.cs index 2ed97bd8e43..5524fcecf3d 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResult.json.cs @@ -75,7 +75,7 @@ internal SapDiskConfigurationsResult(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtu { return; } - {_volumeConfiguration = If( json?.PropertyT("volumeConfigurations"), out var __jsonVolumeConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VolumeConfigurations.FromJson(__jsonVolumeConfigurations) : _volumeConfiguration;} + {_volumeConfiguration = If( json?.PropertyT("volumeConfigurations"), out var __jsonVolumeConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfigurationsResultVolumeConfigurations.FromJson(__jsonVolumeConfigurations) : _volumeConfiguration;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.PowerShell.cs similarity index 77% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.PowerShell.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.PowerShell.cs index 1e57cdd385c..43c257c5e1c 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.PowerShell.cs @@ -9,8 +9,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - [System.ComponentModel.TypeConverter(typeof(VolumeConfigurationsTypeConverter))] - public partial class VolumeConfigurations + [System.ComponentModel.TypeConverter(typeof(SapDiskConfigurationsResultVolumeConfigurationsTypeConverter))] + public partial class SapDiskConfigurationsResultVolumeConfigurations { /// @@ -64,61 +64,49 @@ public partial class VolumeConfigurations partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new VolumeConfigurations(content); + return new SapDiskConfigurationsResultVolumeConfigurations(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new VolumeConfigurations(content); + return new SapDiskConfigurationsResultVolumeConfigurations(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from + /// a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal VolumeConfigurations(global::System.Collections.IDictionary content) + internal SapDiskConfigurationsResultVolumeConfigurations(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -133,11 +121,11 @@ internal VolumeConfigurations(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal VolumeConfigurations(global::System.Management.Automation.PSObject content) + internal SapDiskConfigurationsResultVolumeConfigurations(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -150,11 +138,28 @@ internal VolumeConfigurations(global::System.Management.Automation.PSObject cont CopyFrom(content); AfterDeserializePSObject(content); } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - [System.ComponentModel.TypeConverter(typeof(VolumeConfigurationsTypeConverter))] - public partial interface IVolumeConfigurations + [System.ComponentModel.TypeConverter(typeof(SapDiskConfigurationsResultVolumeConfigurationsTypeConverter))] + public partial interface ISapDiskConfigurationsResultVolumeConfigurations { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.TypeConverter.cs new file mode 100644 index 00000000000..2fd71d553c6 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SapDiskConfigurationsResultVolumeConfigurationsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SapDiskConfigurationsResultVolumeConfigurations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SapDiskConfigurationsResultVolumeConfigurations.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SapDiskConfigurationsResultVolumeConfigurations.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.cs similarity index 71% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.cs index 9d9240f9c5d..8d7bda3a63e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.cs @@ -9,20 +9,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - public partial class VolumeConfigurations : - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations, - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurationsInternal + public partial class SapDiskConfigurationsResultVolumeConfigurations : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurationsInternal { - /// Creates an new instance. - public VolumeConfigurations() + /// + /// Creates an new instance. + /// + public SapDiskConfigurationsResultVolumeConfigurations() { } } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - public partial interface IVolumeConfigurations : + public partial interface ISapDiskConfigurationsResultVolumeConfigurations : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { @@ -30,7 +32,7 @@ public partial interface IVolumeConfigurations : } /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. - internal partial interface IVolumeConfigurationsInternal + internal partial interface ISapDiskConfigurationsResultVolumeConfigurationsInternal { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.dictionary.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.dictionary.cs index 71342b62bc6..a7ccf631e9a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.dictionary.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; - public partial class VolumeConfigurations : + public partial class SapDiskConfigurationsResultVolumeConfigurations : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VolumeConfigurations source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfigurationsResultVolumeConfigurations source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.json.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.json.cs index 52362fea712..9a0d8443f25 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapDiskConfigurationsResultVolumeConfigurations.json.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - public partial class VolumeConfigurations + public partial class SapDiskConfigurationsResultVolumeConfigurations { /// @@ -55,25 +55,45 @@ public partial class VolumeConfigurations partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapDiskConfigurationsResultVolumeConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new VolumeConfigurations(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new SapDiskConfigurationsResultVolumeConfigurations(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SapDiskConfigurationsResultVolumeConfigurations(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfiguration.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) { @@ -89,22 +109,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal VolumeConfigurations(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapDiskConfiguration.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.PowerShell.cs index bfea1773dfa..7bcd582cb6c 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.PowerShell.cs @@ -165,7 +165,7 @@ internal SapVirtualInstance(global::System.Collections.IDictionary content) } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -217,7 +217,7 @@ internal SapVirtualInstance(global::System.Collections.IDictionary content) } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationType")) { @@ -231,10 +231,6 @@ internal SapVirtualInstance(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Code, global::System.Convert.ToString); @@ -243,6 +239,10 @@ internal SapVirtualInstance(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -318,7 +318,7 @@ internal SapVirtualInstance(global::System.Management.Automation.PSObject conten } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -370,7 +370,7 @@ internal SapVirtualInstance(global::System.Management.Automation.PSObject conten } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("ConfigurationType")) { @@ -384,10 +384,6 @@ internal SapVirtualInstance(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Code, global::System.Convert.ToString); @@ -396,6 +392,10 @@ internal SapVirtualInstance(global::System.Management.Automation.PSObject conten { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.cs index f7c6682389b..68023d94b02 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstance.cs @@ -72,7 +72,7 @@ public partial class SapVirtualInstance : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inherited)] @@ -234,7 +234,7 @@ public partial class SapVirtualInstance : /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -369,8 +369,8 @@ public partial interface ISapVirtualInstance : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Managed resource group name [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Info( Required = false, @@ -507,7 +507,7 @@ internal partial interface ISapVirtualInstanceInternal : [global::Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PSArgumentCompleterAttribute("None", "UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Managed resource group configuration Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IManagedRgConfiguration ManagedResourceGroupConfiguration { get; set; } /// Managed resource group name diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceError.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceError.PowerShell.cs index 1ac571de6fd..07319a7a045 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceError.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceError.PowerShell.cs @@ -111,10 +111,6 @@ internal SapVirtualInstanceError(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Code, global::System.Convert.ToString); @@ -123,6 +119,10 @@ internal SapVirtualInstanceError(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -144,10 +144,6 @@ internal SapVirtualInstanceError(global::System.Management.Automation.PSObject c { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Code, global::System.Convert.ToString); @@ -156,6 +152,10 @@ internal SapVirtualInstanceError(global::System.Management.Automation.PSObject c { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.PowerShell.cs index a2875826238..d0227ed7252 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.PowerShell.cs @@ -113,7 +113,7 @@ internal SapVirtualInstanceIdentity1(global::System.Collections.IDictionary cont } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -138,7 +138,7 @@ internal SapVirtualInstanceIdentity1(global::System.Management.Automation.PSObje } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.cs index 07b095dc2f5..e09b85df43e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.cs @@ -19,11 +19,11 @@ public partial class SapVirtualInstanceIdentity1 : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities _userAssignedIdentity; /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public SapVirtualInstanceIdentity1() @@ -56,8 +56,8 @@ public partial interface ISapVirtualInstanceIdentity1 : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (user assigned identities) @@ -68,7 +68,7 @@ internal partial interface ISapVirtualInstanceIdentity1Internal [global::Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PSArgumentCompleterAttribute("None", "UserAssigned")] string Type { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.json.cs index f39cdfc29d4..7c607915393 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentity1.json.cs @@ -76,7 +76,7 @@ internal SapVirtualInstanceIdentity1(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtu return; } {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 00000000000..5565258fc53 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter))] + public partial class SapVirtualInstanceIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SapVirtualInstanceIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SapVirtualInstanceIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SapVirtualInstanceIdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SapVirtualInstanceIdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The identities assigned to this resource by the user. + [System.ComponentModel.TypeConverter(typeof(SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface ISapVirtualInstanceIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 00000000000..97d445db5eb --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable + /// conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SapVirtualInstanceIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SapVirtualInstanceIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SapVirtualInstanceIdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.cs similarity index 64% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.cs index 0bd075bb1e8..7e68454b0cf 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.cs @@ -6,26 +6,28 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentitiesInternal + public partial class SapVirtualInstanceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentitiesInternal { - /// Creates an new instance. - public UserAssignedIdentities() + /// + /// Creates an new instance. + /// + public SapVirtualInstanceIdentityUserAssignedIdentities() { } } /// The identities assigned to this resource by the user. - public partial interface IUserAssignedIdentities : + public partial interface ISapVirtualInstanceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { } /// The identities assigned to this resource by the user. - internal partial interface IUserAssignedIdentitiesInternal + internal partial interface ISapVirtualInstanceIdentityUserAssignedIdentitiesInternal { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.dictionary.cs similarity index 95% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.dictionary.cs index 5496412a406..7744e2c32b8 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.dictionary.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; - public partial class UserAssignedIdentities : + public partial class SapVirtualInstanceIdentityUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.json.cs similarity index 84% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.json.cs index d03121bfeb7..a5aabbaf158 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceIdentityUserAssignedIdentities.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; /// The identities assigned to this resource by the user. - public partial class UserAssignedIdentities + public partial class SapVirtualInstanceIdentityUserAssignedIdentities { /// @@ -52,25 +52,45 @@ public partial class UserAssignedIdentities partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new SapVirtualInstanceIdentityUserAssignedIdentities(json) : null; } /// - /// Serializes this instance of into a . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal SapVirtualInstanceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) { @@ -86,22 +106,5 @@ public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceProperties.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceProperties.PowerShell.cs index 6de41f52b71..61a6719fb15 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceProperties.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SapVirtualInstanceProperties.PowerShell.cs @@ -161,10 +161,6 @@ internal SapVirtualInstanceProperties(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Code, global::System.Convert.ToString); @@ -173,6 +169,10 @@ internal SapVirtualInstanceProperties(global::System.Collections.IDictionary con { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializeDictionary(content); } @@ -242,10 +242,6 @@ internal SapVirtualInstanceProperties(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).ErrorProperty = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IErrorDefinition) content.GetValueForProperty("ErrorProperty",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).ErrorProperty, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom); } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); - } if (content.Contains("Code")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Code, global::System.Convert.ToString); @@ -254,6 +250,10 @@ internal SapVirtualInstanceProperties(global::System.Management.Automation.PSObj { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Message, global::System.Convert.ToString); } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstancePropertiesInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ErrorDefinitionTypeConverter.ConvertFrom)); + } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.PowerShell.cs index 284e11fa0e5..b4a5c9340b3 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.PowerShell.cs @@ -167,7 +167,7 @@ internal SingleServerConfiguration(global::System.Collections.IDictionary conten } if (content.Contains("DbDiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DbDiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DbDiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("CustomResourceNameNamingPatternType")) { @@ -276,7 +276,7 @@ internal SingleServerConfiguration(global::System.Management.Automation.PSObject } if (content.Contains("DbDiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DbDiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DbDiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerConfigurationInternal)this).DbDiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("CustomResourceNameNamingPatternType")) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.cs index 69ff59639bd..b82bdae3006 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerConfiguration.cs @@ -55,7 +55,7 @@ public partial class SingleServerConfiguration : /// 'os'], Optional volume : ['backup']. /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DbDiskConfiguration).DiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DbDiskConfiguration).DiskVolumeConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DbDiskConfiguration).DiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationInternal)DbDiskConfiguration).DiskVolumeConfiguration = value ?? null /* model class */; } /// The SAP deployment type. Eg: SingleServer/ThreeTier. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Constant] @@ -237,8 +237,8 @@ public partial interface ISingleServerConfiguration : Update = true, Description = @"The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup'].", SerializedName = @"diskVolumeConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get; set; } /// /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to /// provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. @@ -410,7 +410,7 @@ internal partial interface ISingleServerConfigurationInternal : /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DbDiskConfigurationDiskVolumeConfiguration { get; set; } /// /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to /// provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.PowerShell.cs index baa4293e4a3..e33a56e8800 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.PowerShell.cs @@ -120,10 +120,6 @@ internal SingleServerFullResourceNames(global::System.Collections.IDictionary co { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerCustomResourceNamesInternal)this).NamingPatternType = (string) content.GetValueForProperty("NamingPatternType",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerCustomResourceNamesInternal)this).NamingPatternType, global::System.Convert.ToString); } - if (content.Contains("VirtualMachineNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachineNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.NetworkInterfaceResourceNamesTypeConverter.ConvertFrom)); - } if (content.Contains("VirtualMachineVMName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineVMName = (string) content.GetValueForProperty("VirtualMachineVMName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineVMName, global::System.Convert.ToString); @@ -132,13 +128,17 @@ internal SingleServerFullResourceNames(global::System.Collections.IDictionary co { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineHostName = (string) content.GetValueForProperty("VirtualMachineHostName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineHostName, global::System.Convert.ToString); } + if (content.Contains("VirtualMachineNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachineNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.NetworkInterfaceResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("VirtualMachineOSDiskName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineOSDiskName = (string) content.GetValueForProperty("VirtualMachineOSDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineOSDiskName, global::System.Convert.ToString); } if (content.Contains("VirtualMachineDataDiskName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) content.GetValueForProperty("VirtualMachineDataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) content.GetValueForProperty("VirtualMachineDataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNamesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -165,10 +165,6 @@ internal SingleServerFullResourceNames(global::System.Management.Automation.PSOb { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerCustomResourceNamesInternal)this).NamingPatternType = (string) content.GetValueForProperty("NamingPatternType",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerCustomResourceNamesInternal)this).NamingPatternType, global::System.Convert.ToString); } - if (content.Contains("VirtualMachineNetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachineNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.NetworkInterfaceResourceNamesTypeConverter.ConvertFrom)); - } if (content.Contains("VirtualMachineVMName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineVMName = (string) content.GetValueForProperty("VirtualMachineVMName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineVMName, global::System.Convert.ToString); @@ -177,13 +173,17 @@ internal SingleServerFullResourceNames(global::System.Management.Automation.PSOb { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineHostName = (string) content.GetValueForProperty("VirtualMachineHostName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineHostName, global::System.Convert.ToString); } + if (content.Contains("VirtualMachineNetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachineNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineNetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.NetworkInterfaceResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("VirtualMachineOSDiskName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineOSDiskName = (string) content.GetValueForProperty("VirtualMachineOSDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineOSDiskName, global::System.Convert.ToString); } if (content.Contains("VirtualMachineDataDiskName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) content.GetValueForProperty("VirtualMachineDataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) content.GetValueForProperty("VirtualMachineDataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISingleServerFullResourceNamesInternal)this).VirtualMachineDataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNamesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.cs index 2796dd80715..82f5e38ba69 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/SingleServerFullResourceNames.cs @@ -44,7 +44,7 @@ public partial class SingleServerFullResourceNames : /// For application and cs layers, only 'default' volume is supported /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames VirtualMachineDataDiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)VirtualMachine).DataDiskName; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)VirtualMachine).DataDiskName = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames VirtualMachineDataDiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)VirtualMachine).DataDiskName; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)VirtualMachine).DataDiskName = value ?? null /* model class */; } /// /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than @@ -114,8 +114,8 @@ public partial interface ISingleServerFullResourceNames : Update = true, Description = @"The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported", SerializedName = @"dataDiskNames", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames VirtualMachineDataDiskName { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames VirtualMachineDataDiskName { get; set; } /// /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than /// or equal to 13 characters long. If this value is not provided, vmName will be used as host name. @@ -189,7 +189,7 @@ internal partial interface ISingleServerFullResourceNamesInternal : /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames VirtualMachineDataDiskName { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames VirtualMachineDataDiskName { get; set; } /// /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than /// or equal to 13 characters long. If this value is not provided, vmName will be used as host name. diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs deleted file mode 100644 index ea3cc502640..00000000000 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.TypeConverter.cs +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Tags.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Tags.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.PowerShell.cs index 868eb494747..2e4ebdb7558 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.PowerShell.cs @@ -267,7 +267,7 @@ internal ThreeTierConfiguration(global::System.Collections.IDictionary content) } if (content.Contains("DiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("TransportFileShareConfigurationType")) { @@ -532,7 +532,7 @@ internal ThreeTierConfiguration(global::System.Management.Automation.PSObject co } if (content.Contains("DiskConfigurationDiskVolumeConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskVolumeConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) content.GetValueForProperty("DiskConfigurationDiskVolumeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierConfigurationInternal)this).DiskConfigurationDiskVolumeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DiskConfigurationDiskVolumeConfigurationsTypeConverter.ConvertFrom); } if (content.Contains("TransportFileShareConfigurationType")) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.cs index ae2740b488e..05db1d91856 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierConfiguration.cs @@ -293,7 +293,7 @@ public partial class ThreeTierConfiguration : /// 'os'], Optional volume : ['backup']. /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)DatabaseServer).DiskConfigurationDiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)DatabaseServer).DiskConfigurationDiskVolumeConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)DatabaseServer).DiskConfigurationDiskVolumeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDatabaseConfigurationInternal)DatabaseServer).DiskConfigurationDiskVolumeConfiguration = value ?? null /* model class */; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IHighAvailabilityConfiguration _highAvailabilityConfig; @@ -913,8 +913,8 @@ public partial interface IThreeTierConfiguration : Update = true, Description = @"The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup'].", SerializedName = @"diskVolumeConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } /// The high availability type. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Info( Required = false, @@ -1150,7 +1150,7 @@ internal partial interface IThreeTierConfigurationInternal : /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', /// 'os'], Optional volume : ['backup']. /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskConfigurationDiskVolumeConfigurations DiskConfigurationDiskVolumeConfiguration { get; set; } /// The high availability configuration. Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IHighAvailabilityConfiguration HighAvailabilityConfig { get; set; } /// The high availability type. diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierFullResourceNames.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierFullResourceNames.PowerShell.cs index 8804a919d00..5042c9e17bf 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierFullResourceNames.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/ThreeTierFullResourceNames.PowerShell.cs @@ -130,26 +130,22 @@ internal ThreeTierFullResourceNames(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierCustomResourceNamesInternal)this).NamingPatternType = (string) content.GetValueForProperty("NamingPatternType",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierCustomResourceNamesInternal)this).NamingPatternType, global::System.Convert.ToString); } - if (content.Contains("CentralServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("CentralServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } - if (content.Contains("ApplicationServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } - if (content.Contains("DatabaseServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("DatabaseServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } if (content.Contains("CentralServerLoadBalancer")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerLoadBalancer = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerResourceNames) content.GetValueForProperty("CentralServerLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerLoadBalancer, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerResourceNamesTypeConverter.ConvertFrom); } + if (content.Contains("CentralServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("CentralServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("CentralServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerAvailabilitySetName = (string) content.GetValueForProperty("CentralServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerAvailabilitySetName, global::System.Convert.ToString); } + if (content.Contains("ApplicationServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("ApplicationServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerAvailabilitySetName = (string) content.GetValueForProperty("ApplicationServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerAvailabilitySetName, global::System.Convert.ToString); @@ -158,6 +154,10 @@ internal ThreeTierFullResourceNames(global::System.Collections.IDictionary conte { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerLoadBalancer = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerResourceNames) content.GetValueForProperty("DatabaseServerLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerLoadBalancer, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerResourceNamesTypeConverter.ConvertFrom); } + if (content.Contains("DatabaseServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("DatabaseServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("DatabaseServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerAvailabilitySetName = (string) content.GetValueForProperty("DatabaseServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerAvailabilitySetName, global::System.Convert.ToString); @@ -239,26 +239,22 @@ internal ThreeTierFullResourceNames(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierCustomResourceNamesInternal)this).NamingPatternType = (string) content.GetValueForProperty("NamingPatternType",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierCustomResourceNamesInternal)this).NamingPatternType, global::System.Convert.ToString); } - if (content.Contains("CentralServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("CentralServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } - if (content.Contains("ApplicationServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } - if (content.Contains("DatabaseServerVirtualMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("DatabaseServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); - } if (content.Contains("CentralServerLoadBalancer")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerLoadBalancer = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerResourceNames) content.GetValueForProperty("CentralServerLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerLoadBalancer, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerResourceNamesTypeConverter.ConvertFrom); } + if (content.Contains("CentralServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("CentralServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("CentralServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerAvailabilitySetName = (string) content.GetValueForProperty("CentralServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).CentralServerAvailabilitySetName, global::System.Convert.ToString); } + if (content.Contains("ApplicationServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("ApplicationServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("ApplicationServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerAvailabilitySetName = (string) content.GetValueForProperty("ApplicationServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).ApplicationServerAvailabilitySetName, global::System.Convert.ToString); @@ -267,6 +263,10 @@ internal ThreeTierFullResourceNames(global::System.Management.Automation.PSObjec { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerLoadBalancer = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ILoadBalancerResourceNames) content.GetValueForProperty("DatabaseServerLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerLoadBalancer, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.LoadBalancerResourceNamesTypeConverter.ConvertFrom); } + if (content.Contains("DatabaseServerVirtualMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine = (System.Collections.Generic.List) content.GetValueForProperty("DatabaseServerVirtualMachine",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerVirtualMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesTypeConverter.ConvertFrom)); + } if (content.Contains("DatabaseServerAvailabilitySetName")) { ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerAvailabilitySetName = (string) content.GetValueForProperty("DatabaseServerAvailabilitySetName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IThreeTierFullResourceNamesInternal)this).DatabaseServerAvailabilitySetName, global::System.Convert.ToString); diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs index 60243fdd14b..d834ad15f7a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.PowerShell.cs @@ -128,7 +128,7 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { @@ -193,7 +193,7 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.cs index 723e10621cb..e08d2e0ba1e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.cs @@ -97,11 +97,11 @@ public partial class TrackedResource : public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -152,8 +152,8 @@ public partial interface ITrackedResource : Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' @@ -163,7 +163,7 @@ internal partial interface ITrackedResourceInternal : /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.json.cs index 27f75cfb1f8..a3657f3069b 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResource.json.cs @@ -107,7 +107,7 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.R return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 81% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.PowerShell.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs index b6c35dcf0ff..c608c2871a5 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -6,8 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial class Tags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags { /// @@ -61,44 +61,61 @@ public partial class Tags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Tags(content); + return new TrackedResourceTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Tags(global::System.Collections.IDictionary content) + internal TrackedResourceTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -113,11 +130,11 @@ internal Tags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Tags(global::System.Management.Automation.PSObject content) + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,27 +147,10 @@ internal Tags(global::System.Management.Automation.PSObject content) CopyFrom(content); AfterDeserializePSObject(content); } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } } /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))] - public partial interface ITags + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 85% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.TypeConverter.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 15134ec4705..a3da78dc523 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class DataDiskNamesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,13 @@ public partial class DataDiskNamesTypeConverter : global::System.Management.Auto public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +93,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } try { - return DataDiskNames.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +125,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IData } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return DataDiskNames.DeserializeFromPSObject(sourceValue); + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return DataDiskNames.DeserializeFromDictionary(sourceValue); + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.cs similarity index 71% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.cs index 65755a8af00..9facd2c0bea 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.cs @@ -6,26 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; /// Resource tags. - public partial class Tags : - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags, - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITagsInternal + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTagsInternal { - /// Creates an new instance. - public Tags() + /// Creates an new instance. + public TrackedResourceTags() { } } /// Resource tags. - public partial interface ITags : + public partial interface ITrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { } /// Resource tags. - internal partial interface ITagsInternal + internal partial interface ITrackedResourceTagsInternal { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.dictionary.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs index b5beefa040e..98e5fcfaf6e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.dictionary.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; - public partial class Tags : + public partial class TrackedResourceTags : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray { protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs similarity index 87% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.json.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs index e5f562df028..082e1b92990 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/Tags.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/TrackedResourceTags.json.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; /// Resource tags. - public partial class Tags + public partial class TrackedResourceTags { /// @@ -52,42 +52,25 @@ public partial class Tags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new Tags(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal Tags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) { @@ -103,5 +86,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.PowerShell.cs index ab42dac083d..ff95b95ca1d 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.PowerShell.cs @@ -130,7 +130,7 @@ internal UpdateSapApplicationInstanceRequest(global::System.Collections.IDiction // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapApplicationInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -151,7 +151,7 @@ internal UpdateSapApplicationInstanceRequest(global::System.Management.Automatio // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapApplicationInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.cs index 14a542207d4..0528108644c 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.cs @@ -12,11 +12,11 @@ public partial class UpdateSapApplicationInstanceRequest : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags _tag; /// Gets or sets the Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapApplicationInstanceRequestTags()); set => this._tag = value; } /// Creates an new instance. public UpdateSapApplicationInstanceRequest() @@ -37,8 +37,8 @@ public partial interface IUpdateSapApplicationInstanceRequest : Update = true, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get; set; } } /// Defines the request body for updating SAP Application Instance. @@ -46,7 +46,7 @@ internal partial interface IUpdateSapApplicationInstanceRequestInternal { /// Gets or sets the Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.json.cs index 0843dbd4aed..999ea56d01e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequest.json.cs @@ -100,7 +100,7 @@ internal UpdateSapApplicationInstanceRequest(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapApplicationInstanceRequestTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.PowerShell.cs new file mode 100644 index 00000000000..117d0d0ba8f --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapApplicationInstanceRequestTagsTypeConverter))] + public partial class UpdateSapApplicationInstanceRequestTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateSapApplicationInstanceRequestTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateSapApplicationInstanceRequestTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateSapApplicationInstanceRequestTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateSapApplicationInstanceRequestTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapApplicationInstanceRequestTagsTypeConverter))] + public partial interface IUpdateSapApplicationInstanceRequestTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.TypeConverter.cs new file mode 100644 index 00000000000..464197095d7 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateSapApplicationInstanceRequestTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateSapApplicationInstanceRequestTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateSapApplicationInstanceRequestTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateSapApplicationInstanceRequestTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.cs new file mode 100644 index 00000000000..17c8c9f1b46 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapApplicationInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTagsInternal + { + + /// Creates an new instance. + public UpdateSapApplicationInstanceRequestTags() + { + + } + } + /// Gets or sets the Resource tags. + public partial interface IUpdateSapApplicationInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + + } + /// Gets or sets the Resource tags. + internal partial interface IUpdateSapApplicationInstanceRequestTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.dictionary.cs new file mode 100644 index 00000000000..3acf2ea5bc7 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + public partial class UpdateSapApplicationInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapApplicationInstanceRequestTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.json.cs new file mode 100644 index 00000000000..9cc7ed59d24 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapApplicationInstanceRequestTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapApplicationInstanceRequestTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new UpdateSapApplicationInstanceRequestTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UpdateSapApplicationInstanceRequestTags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.PowerShell.cs index 6a8619da485..3071663e600 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.PowerShell.cs @@ -128,7 +128,7 @@ internal UpdateSapCentralInstanceRequest(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapCentralInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -149,7 +149,7 @@ internal UpdateSapCentralInstanceRequest(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapCentralInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.cs index bb8a685d647..93b100219d1 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.cs @@ -12,11 +12,11 @@ public partial class UpdateSapCentralInstanceRequest : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags _tag; /// Gets or sets the Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapCentralInstanceRequestTags()); set => this._tag = value; } /// Creates an new instance. public UpdateSapCentralInstanceRequest() @@ -37,8 +37,8 @@ public partial interface IUpdateSapCentralInstanceRequest : Update = true, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get; set; } } /// Defines the request body for updating SAP Central Instance. @@ -46,7 +46,7 @@ internal partial interface IUpdateSapCentralInstanceRequestInternal { /// Gets or sets the Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.json.cs index 2bb9805b485..411f0e30f8c 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequest.json.cs @@ -99,7 +99,7 @@ internal UpdateSapCentralInstanceRequest(Microsoft.Azure.PowerShell.Cmdlets.SAPV { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapCentralInstanceRequestTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.PowerShell.cs similarity index 77% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.PowerShell.cs index eff4f9cef64..1f863ac9884 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.PowerShell.cs @@ -5,9 +5,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapCentralInstanceRequestTagsTypeConverter))] + public partial class UpdateSapCentralInstanceRequestTags { /// @@ -61,37 +61,41 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UserAssignedIdentities(content); + return new UpdateSapCentralInstanceRequestTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UserAssignedIdentities(content); + return new UpdateSapCentralInstanceRequestTags(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -111,11 +115,11 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UserAssignedIdentities(global::System.Collections.IDictionary content) + internal UpdateSapCentralInstanceRequestTags(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -130,11 +134,11 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + internal UpdateSapCentralInstanceRequestTags(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -148,9 +152,9 @@ internal UserAssignedIdentities(global::System.Management.Automation.PSObject co AfterDeserializePSObject(content); } } - /// The identities assigned to this resource by the user. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapCentralInstanceRequestTagsTypeConverter))] + public partial interface IUpdateSapCentralInstanceRequestTags { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.TypeConverter.cs similarity index 82% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.TypeConverter.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.TypeConverter.cs index 4a09b1ac5a1..c89e9300e95 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VolumeConfigurations.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class VolumeConfigurationsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class UpdateSapCentralInstanceRequestTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,14 @@ public partial class VolumeConfigurationsTypeConverter : global::System.Manageme public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise + /// false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +94,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolumeConfigurations).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags).IsAssignableFrom(type)) { return sourceValue; } try { - return VolumeConfigurations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return UpdateSapCentralInstanceRequestTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +127,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVolu } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return VolumeConfigurations.DeserializeFromPSObject(sourceValue); + return UpdateSapCentralInstanceRequestTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return VolumeConfigurations.DeserializeFromDictionary(sourceValue); + return UpdateSapCentralInstanceRequestTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.cs new file mode 100644 index 00000000000..270fd134b44 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapCentralInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTagsInternal + { + + /// Creates an new instance. + public UpdateSapCentralInstanceRequestTags() + { + + } + } + /// Gets or sets the Resource tags. + public partial interface IUpdateSapCentralInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + + } + /// Gets or sets the Resource tags. + internal partial interface IUpdateSapCentralInstanceRequestTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.dictionary.cs new file mode 100644 index 00000000000..f72e8edc2fb --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + public partial class UpdateSapCentralInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapCentralInstanceRequestTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.json.cs new file mode 100644 index 00000000000..35a5d387a3c --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapCentralInstanceRequestTags.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapCentralInstanceRequestTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new UpdateSapCentralInstanceRequestTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UpdateSapCentralInstanceRequestTags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.PowerShell.cs index baa0904b54a..a279fcf4f5b 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.PowerShell.cs @@ -128,7 +128,7 @@ internal UpdateSapDatabaseInstanceRequest(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapDatabaseInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -149,7 +149,7 @@ internal UpdateSapDatabaseInstanceRequest(global::System.Management.Automation.P // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapDatabaseInstanceRequestTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.cs index cbf6ba2f39f..971968cb486 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.cs @@ -12,11 +12,11 @@ public partial class UpdateSapDatabaseInstanceRequest : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags _tag; /// Gets or sets the Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapDatabaseInstanceRequestTags()); set => this._tag = value; } /// Creates an new instance. public UpdateSapDatabaseInstanceRequest() @@ -37,8 +37,8 @@ public partial interface IUpdateSapDatabaseInstanceRequest : Update = true, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get; set; } } /// Defines the request body for updating SAP Database Instance. @@ -46,7 +46,7 @@ internal partial interface IUpdateSapDatabaseInstanceRequestInternal { /// Gets or sets the Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.json.cs index 0726193f563..072294ae1fa 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequest.json.cs @@ -99,7 +99,7 @@ internal UpdateSapDatabaseInstanceRequest(Microsoft.Azure.PowerShell.Cmdlets.SAP { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapDatabaseInstanceRequestTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.PowerShell.cs new file mode 100644 index 00000000000..b2612ba1b67 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapDatabaseInstanceRequestTagsTypeConverter))] + public partial class UpdateSapDatabaseInstanceRequestTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateSapDatabaseInstanceRequestTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateSapDatabaseInstanceRequestTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateSapDatabaseInstanceRequestTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateSapDatabaseInstanceRequestTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapDatabaseInstanceRequestTagsTypeConverter))] + public partial interface IUpdateSapDatabaseInstanceRequestTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.TypeConverter.cs similarity index 82% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.TypeConverter.cs index 4aa7b9cd194..e757709d96a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UserAssignedIdentities.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.TypeConverter.cs @@ -6,9 +6,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class UpdateSapDatabaseInstanceRequestTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +25,14 @@ public partial class UserAssignedIdentitiesTypeConverter : global::System.Manage public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise + /// false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +95,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags).IsAssignableFrom(type)) { return sourceValue; } try { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return UpdateSapDatabaseInstanceRequestTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +128,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUser } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + return UpdateSapDatabaseInstanceRequestTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + return UpdateSapDatabaseInstanceRequestTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.cs new file mode 100644 index 00000000000..a804ced4614 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapDatabaseInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTagsInternal + { + + /// Creates an new instance. + public UpdateSapDatabaseInstanceRequestTags() + { + + } + } + /// Gets or sets the Resource tags. + public partial interface IUpdateSapDatabaseInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + + } + /// Gets or sets the Resource tags. + internal partial interface IUpdateSapDatabaseInstanceRequestTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.dictionary.cs new file mode 100644 index 00000000000..35840b4e172 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + public partial class UpdateSapDatabaseInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapDatabaseInstanceRequestTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.json.cs new file mode 100644 index 00000000000..7ee01a23cf0 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapDatabaseInstanceRequestTags.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapDatabaseInstanceRequestTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new UpdateSapDatabaseInstanceRequestTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UpdateSapDatabaseInstanceRequestTags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.PowerShell.cs index 3c1817dc0d6..c3a99a9bcfb 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.PowerShell.cs @@ -136,7 +136,7 @@ internal UpdateSapVirtualInstanceRequest(global::System.Collections.IDictionary } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceRequestTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { @@ -144,7 +144,7 @@ internal UpdateSapVirtualInstanceRequest(global::System.Collections.IDictionary } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("ManagedResourcesNetworkAccessType")) { @@ -177,7 +177,7 @@ internal UpdateSapVirtualInstanceRequest(global::System.Management.Automation.PS } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.TagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceRequestTagsTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { @@ -185,7 +185,7 @@ internal UpdateSapVirtualInstanceRequest(global::System.Management.Automation.PS } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("ManagedResourcesNetworkAccessType")) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.cs index cb4bcf75834..15ef5dfeb26 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.cs @@ -24,7 +24,7 @@ public partial class UpdateSapVirtualInstanceRequest : /// The identities assigned to this resource by the user. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentity1Internal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The @@ -50,11 +50,11 @@ public partial class UpdateSapVirtualInstanceRequest : internal Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags _tag; /// Gets or sets the Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceRequestTags()); set => this._tag = value; } /// Creates an new instance. public UpdateSapVirtualInstanceRequest() @@ -87,8 +87,8 @@ public partial interface IUpdateSapVirtualInstanceRequest : Update = true, Description = @"The identities assigned to this resource by the user.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The /// options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled @@ -116,8 +116,8 @@ public partial interface IUpdateSapVirtualInstanceRequest : Update = true, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags Tag { get; set; } } /// Defines the request body for updating Virtual Instance for SAP. @@ -130,7 +130,7 @@ internal partial interface IUpdateSapVirtualInstanceRequestInternal [global::Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PSArgumentCompleterAttribute("None", "UserAssigned")] string IdentityType { get; set; } /// The identities assigned to this resource by the user. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ISapVirtualInstanceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The /// options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled @@ -143,7 +143,7 @@ internal partial interface IUpdateSapVirtualInstanceRequestInternal /// The update properties. Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceProperties Property { get; set; } /// Gets or sets the Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags Tag { get; set; } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.json.cs index 07ed7a6ecaf..76a97d81044 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequest.json.cs @@ -103,7 +103,7 @@ internal UpdateSapVirtualInstanceRequest(Microsoft.Azure.PowerShell.Cmdlets.SAPV } {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.SapVirtualInstanceIdentity1.FromJson(__jsonIdentity) : _identity;} {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceProperties.FromJson(__jsonProperties) : _property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.Tags.FromJson(__jsonTags) : _tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceRequestTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.PowerShell.cs new file mode 100644 index 00000000000..aa0cec7523d --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapVirtualInstanceRequestTagsTypeConverter))] + public partial class UpdateSapVirtualInstanceRequestTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateSapVirtualInstanceRequestTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateSapVirtualInstanceRequestTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateSapVirtualInstanceRequestTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateSapVirtualInstanceRequestTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Gets or sets the Resource tags. + [System.ComponentModel.TypeConverter(typeof(UpdateSapVirtualInstanceRequestTagsTypeConverter))] + public partial interface IUpdateSapVirtualInstanceRequestTags + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.TypeConverter.cs similarity index 82% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.TypeConverter.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.TypeConverter.cs index 7c7f3b26f79..f1ca08fdbbd 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DiskVolumeConfigurations.TypeConverter.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.TypeConverter.cs @@ -6,9 +6,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class DiskVolumeConfigurationsTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class UpdateSapVirtualInstanceRequestTagsTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -24,13 +24,14 @@ public partial class DiskVolumeConfigurationsTypeConverter : global::System.Mana public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise + /// false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -93,31 +94,32 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDiskVolumeConfigurations).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags).IsAssignableFrom(type)) { return sourceValue; } try { - return DiskVolumeConfigurations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return UpdateSapVirtualInstanceRequestTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -125,11 +127,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDisk } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return DiskVolumeConfigurations.DeserializeFromPSObject(sourceValue); + return UpdateSapVirtualInstanceRequestTags.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return DiskVolumeConfigurations.DeserializeFromDictionary(sourceValue); + return UpdateSapVirtualInstanceRequestTags.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.cs new file mode 100644 index 00000000000..481a791b9a4 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapVirtualInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTagsInternal + { + + /// Creates an new instance. + public UpdateSapVirtualInstanceRequestTags() + { + + } + } + /// Gets or sets the Resource tags. + public partial interface IUpdateSapVirtualInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + + } + /// Gets or sets the Resource tags. + internal partial interface IUpdateSapVirtualInstanceRequestTagsInternal + + { + + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.dictionary.cs new file mode 100644 index 00000000000..84a8ae161f4 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.dictionary.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + public partial class UpdateSapVirtualInstanceRequestTags : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.UpdateSapVirtualInstanceRequestTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.json.cs new file mode 100644 index 00000000000..c6307004008 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/UpdateSapVirtualInstanceRequestTags.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; + + /// Gets or sets the Resource tags. + public partial class UpdateSapVirtualInstanceRequestTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapVirtualInstanceRequestTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new UpdateSapVirtualInstanceRequestTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UpdateSapVirtualInstanceRequestTags(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.PowerShell.cs index 97f5973c0cb..da3de5a6434 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.PowerShell.cs @@ -142,7 +142,7 @@ internal VirtualMachineResourceNames(global::System.Collections.IDictionary cont } if (content.Contains("DataDiskName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) content.GetValueForProperty("DataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) content.GetValueForProperty("DataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNamesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } @@ -179,7 +179,7 @@ internal VirtualMachineResourceNames(global::System.Management.Automation.PSObje } if (content.Contains("DataDiskName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) content.GetValueForProperty("DataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) content.GetValueForProperty("DataDiskName",((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesInternal)this).DataDiskName, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNamesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.cs index cc968cf6f00..637674fa382 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.cs @@ -12,7 +12,7 @@ public partial class VirtualMachineResourceNames : { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames _dataDiskName; + private Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames _dataDiskName; /// /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per @@ -20,7 +20,7 @@ public partial class VirtualMachineResourceNames : /// For application and cs layers, only 'default' volume is supported /// [Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames DataDiskName { get => (this._dataDiskName = this._dataDiskName ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNames()); set => this._dataDiskName = value; } + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames DataDiskName { get => (this._dataDiskName = this._dataDiskName ?? new Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNames()); set => this._dataDiskName = value; } /// Backing field for property. private string _hostName; @@ -88,8 +88,8 @@ public partial interface IVirtualMachineResourceNames : Update = true, Description = @"The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported", SerializedName = @"dataDiskNames", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames) })] - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames DataDiskName { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames) })] + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames DataDiskName { get; set; } /// /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than /// or equal to 13 characters long. If this value is not provided, vmName will be used as host name. @@ -160,7 +160,7 @@ internal partial interface IVirtualMachineResourceNamesInternal /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported /// - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames DataDiskName { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames DataDiskName { get; set; } /// /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than /// or equal to 13 characters long. If this value is not provided, vmName will be used as host name. diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.json.cs index ad06851eebe..4de6b139a59 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNames.json.cs @@ -115,7 +115,7 @@ internal VirtualMachineResourceNames(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtu {_hostName = If( json?.PropertyT("hostName"), out var __jsonHostName) ? (string)__jsonHostName : (string)_hostName;} {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.INetworkInterfaceResourceNames) (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.NetworkInterfaceResourceNames.FromJson(__u) )) ))() : null : _networkInterface;} {_oSDiskName = If( json?.PropertyT("osDiskName"), out var __jsonOSDiskName) ? (string)__jsonOSDiskName : (string)_oSDiskName;} - {_dataDiskName = If( json?.PropertyT("dataDiskNames"), out var __jsonDataDiskNames) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNames.FromJson(__jsonDataDiskNames) : _dataDiskName;} + {_dataDiskName = If( json?.PropertyT("dataDiskNames"), out var __jsonDataDiskNames) ? Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNames.FromJson(__jsonDataDiskNames) : _dataDiskName;} AfterFromJson(json); } } diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.PowerShell.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.PowerShell.cs similarity index 79% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.PowerShell.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.PowerShell.cs index 81909df07d4..39a809f8e57 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.PowerShell.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.PowerShell.cs @@ -10,8 +10,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported /// - [System.ComponentModel.TypeConverter(typeof(DataDiskNamesTypeConverter))] - public partial class DataDiskNames + [System.ComponentModel.TypeConverter(typeof(VirtualMachineResourceNamesDataDiskNamesTypeConverter))] + public partial class VirtualMachineResourceNamesDataDiskNames { /// @@ -65,75 +65,42 @@ public partial class DataDiskNames partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DataDiskNames(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DataDiskNames(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new DataDiskNames(content); + return new VirtualMachineResourceNamesDataDiskNames(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new DataDiskNames(content); + return new VirtualMachineResourceNamesDataDiskNames(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json + /// string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -151,12 +118,50 @@ public override string ToString() } return ToJsonString(); } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualMachineResourceNamesDataDiskNames(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachineResourceNamesDataDiskNames(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } } /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported - [System.ComponentModel.TypeConverter(typeof(DataDiskNamesTypeConverter))] - public partial interface IDataDiskNames + [System.ComponentModel.TypeConverter(typeof(VirtualMachineResourceNamesDataDiskNamesTypeConverter))] + public partial interface IVirtualMachineResourceNamesDataDiskNames { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.TypeConverter.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.TypeConverter.cs new file mode 100644 index 00000000000..95d0b749602 --- /dev/null +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualMachineResourceNamesDataDiskNamesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualMachineResourceNamesDataDiskNames.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualMachineResourceNamesDataDiskNames.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualMachineResourceNamesDataDiskNames.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.cs similarity index 78% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.cs index d81db5b040c..42de21ff2de 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.cs @@ -10,13 +10,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported /// - public partial class DataDiskNames : - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames, - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNamesInternal + public partial class VirtualMachineResourceNamesDataDiskNames : + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames, + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNamesInternal { - /// Creates an new instance. - public DataDiskNames() + /// + /// Creates an new instance. + /// + public VirtualMachineResourceNamesDataDiskNames() { } @@ -24,7 +26,7 @@ public DataDiskNames() /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported - public partial interface IDataDiskNames : + public partial interface IVirtualMachineResourceNamesDataDiskNames : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IJsonSerializable, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray> { @@ -33,7 +35,7 @@ public partial interface IDataDiskNames : /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported - internal partial interface IDataDiskNamesInternal + internal partial interface IVirtualMachineResourceNamesDataDiskNamesInternal { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.dictionary.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.dictionary.cs similarity index 96% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.dictionary.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.dictionary.cs index f08805bb39d..cccbdc34877 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.dictionary.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.dictionary.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models { using static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Extensions; - public partial class DataDiskNames : + public partial class VirtualMachineResourceNamesDataDiskNames : Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray> { protected global::System.Collections.Generic.Dictionary> __additionalProperties = new global::System.Collections.Generic.Dictionary>(); @@ -68,6 +68,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary>(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.DataDiskNames source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary>(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.VirtualMachineResourceNamesDataDiskNames source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.json.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.json.cs similarity index 85% rename from tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.json.cs rename to tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.json.cs index fdd61d50f85..33d95f1270f 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/DataDiskNames.json.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/api/Models/VirtualMachineResourceNamesDataDiskNames.json.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models /// volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. /// For application and cs layers, only 'default' volume is supported /// - public partial class DataDiskNames + public partial class VirtualMachineResourceNamesDataDiskNames { /// @@ -56,42 +56,27 @@ public partial class DataDiskNames partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. - /// - internal DataDiskNames(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray>)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames. /// - public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IDataDiskNames FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IVirtualMachineResourceNamesDataDiskNames FromJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new DataDiskNames(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json ? new VirtualMachineResourceNamesDataDiskNames(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.SerializationMode serializationMode) { @@ -107,5 +92,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonNo AfterToJson(ref container); return container; } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal VirtualMachineResourceNamesDataDiskNames(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Runtime.IAssociativeArray>)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } } } \ No newline at end of file diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateExpanded.cs index b1f104856f9..1b4fd4ebf11 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateExpanded.cs @@ -206,8 +206,8 @@ public partial class NewAzSapVirtualInstanceSapApplicationServerInstance_CreateE ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentityExpanded.cs index 6717cadf408..26d79ffa84f 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentityExpanded.cs @@ -153,8 +153,8 @@ public partial class NewAzSapVirtualInstanceSapApplicationServerInstance_CreateV ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs index f8816acd6b4..c46d1333f46 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapApplicationServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs @@ -167,8 +167,8 @@ public partial class NewAzSapVirtualInstanceSapApplicationServerInstance_CreateV ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateExpanded.cs index 74585f2df0d..34b5ff2dcdc 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateExpanded.cs @@ -208,8 +208,8 @@ public partial class NewAzSapVirtualInstanceSapCentralServerInstance_CreateExpan ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentityExpanded.cs index 69d04cb00c5..683af77cd05 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentityExpanded.cs @@ -153,8 +153,8 @@ public partial class NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaId ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs index 282bec2f8f4..02c075ac854 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs @@ -169,8 +169,8 @@ public partial class NewAzSapVirtualInstanceSapCentralServerInstance_CreateViaId ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateExpanded.cs index 295d00159e1..1d72ebc160a 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateExpanded.cs @@ -208,8 +208,8 @@ public partial class NewAzSapVirtualInstanceSapDatabaseInstance_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentityExpanded.cs index 78cbd10c04e..487c39a0e21 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentityExpanded.cs @@ -153,8 +153,8 @@ public partial class NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentit ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs index 7c130fec1dd..451e6b3d8c5 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentitySapVirtualInstanceExpanded.cs @@ -169,8 +169,8 @@ public partial class NewAzSapVirtualInstanceSapDatabaseInstance_CreateViaIdentit ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateExpanded.cs index f718b6810af..0b824c84c1d 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateExpanded.cs @@ -259,8 +259,8 @@ public partial class NewAzSapVirtualInstanceSapVirtualInstance_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateViaIdentityExpanded.cs index 7df303c1e9a..ed3f0fe1aab 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/NewAzSapVirtualInstanceSapVirtualInstance_CreateViaIdentityExpanded.cs @@ -219,8 +219,8 @@ public partial class NewAzSapVirtualInstanceSapVirtualInstance_CreateViaIdentity ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateExpanded.cs index 397c58962b9..79aedf088f2 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateExpanded.cs @@ -188,8 +188,8 @@ public partial class UpdateAzSapVirtualInstanceSapApplicationServerInstance_Upda ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentityExpanded.cs index 0983ba1193c..fd5b6dbd99e 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentityExpanded.cs @@ -135,8 +135,8 @@ public partial class UpdateAzSapVirtualInstanceSapApplicationServerInstance_Upda ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs index ec4418151a2..89252958364 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapApplicationServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs @@ -149,8 +149,8 @@ public partial class UpdateAzSapVirtualInstanceSapApplicationServerInstance_Upda ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapApplicationInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateExpanded.cs index 37821248823..95db2a2d766 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateExpanded.cs @@ -192,8 +192,8 @@ public partial class UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateEx ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentityExpanded.cs index a601fa4f505..476becad6af 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentityExpanded.cs @@ -137,8 +137,8 @@ public partial class UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateVi ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs index e0d775d438b..a65f29d4ff0 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs @@ -153,8 +153,8 @@ public partial class UpdateAzSapVirtualInstanceSapCentralServerInstance_UpdateVi ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapCentralInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateExpanded.cs index d314972fe5f..7a0df89ea40 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateExpanded.cs @@ -190,8 +190,8 @@ public partial class UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateExpande ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentityExpanded.cs index a860ee139d8..867b42b8691 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentityExpanded.cs @@ -135,8 +135,8 @@ public partial class UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIden ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs index c2bd8c9319e..5f9f8f38934 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIdentitySapVirtualInstanceExpanded.cs @@ -151,8 +151,8 @@ public partial class UpdateAzSapVirtualInstanceSapDatabaseInstance_UpdateViaIden ReadOnly = false, Description = @"Gets or sets the Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.IUpdateSapDatabaseInstanceRequestTags Tag { get => _propertiesBody.Tag ?? null /* object */; set => _propertiesBody.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateExpanded.cs index c0aa31b868f..c33759052f1 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateExpanded.cs @@ -224,8 +224,8 @@ public partial class UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateExpanded ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -588,7 +588,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ManagedResourcesNetworkAccessType"))) { diff --git a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateViaIdentityExpanded.cs b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateViaIdentityExpanded.cs index 93d4b5195d0..22788f567f0 100644 --- a/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateViaIdentityExpanded.cs +++ b/tests-upgrade/tests-emitter/Workloads.SAPVirtualInstance.Management/target/generated/cmdlets/UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateViaIdentityExpanded.cs @@ -184,8 +184,8 @@ public partial class UpdateAzSapVirtualInstanceSapVirtualInstance_UpdateViaIdent ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags) })] - public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags Tag { get => _resourceBody.Tag ?? null /* object */; set => _resourceBody.Tag = value; } /// /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in @@ -569,7 +569,7 @@ private void Update_resourceBody() { if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITags)(this.MyInvocation?.BoundParameters["Tag"]); + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.SAPVirtualInstance.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); } if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ManagedResourcesNetworkAccessType"))) {