diff --git a/samples/AzureSample.ResourceManager.Sample/src/Generated/Models/AzureSampleResourceManagerSampleContext.cs b/samples/AzureSample.ResourceManager.Sample/src/Generated/Models/AzureSampleResourceManagerSampleContext.cs index bcdb99a68d3..9fd62cef858 100644 --- a/samples/AzureSample.ResourceManager.Sample/src/Generated/Models/AzureSampleResourceManagerSampleContext.cs +++ b/samples/AzureSample.ResourceManager.Sample/src/Generated/Models/AzureSampleResourceManagerSampleContext.cs @@ -7,6 +7,7 @@ using System.ClientModel.Primitives; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; using AzureSample.ResourceManager.Sample.Models; namespace AzureSample.ResourceManager.Sample @@ -47,6 +48,7 @@ namespace AzureSample.ResourceManager.Sample [ModelReaderWriterBuildable(typeof(DiffDiskSettings))] [ModelReaderWriterBuildable(typeof(DiskEncryptionSettings))] [ModelReaderWriterBuildable(typeof(DiskInstanceView))] + [ModelReaderWriterBuildable(typeof(ExtendedLocation))] [ModelReaderWriterBuildable(typeof(ImageData))] [ModelReaderWriterBuildable(typeof(ImageDataDisk))] [ModelReaderWriterBuildable(typeof(ImageDisk))] @@ -67,6 +69,7 @@ namespace AzureSample.ResourceManager.Sample [ModelReaderWriterBuildable(typeof(LogAnalyticsInputBase))] [ModelReaderWriterBuildable(typeof(MaintenanceRedeployStatus))] [ModelReaderWriterBuildable(typeof(ManagedDiskParameters))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] [ModelReaderWriterBuildable(typeof(NetworkInterfaceReference))] [ModelReaderWriterBuildable(typeof(OrchestrationServiceStateContent))] [ModelReaderWriterBuildable(typeof(OrchestrationServiceSummary))] @@ -91,7 +94,8 @@ namespace AzureSample.ResourceManager.Sample [ModelReaderWriterBuildable(typeof(SshPublicKeyResource))] [ModelReaderWriterBuildable(typeof(SshPublicKeysGroupListResult))] [ModelReaderWriterBuildable(typeof(StorageProfile))] - [ModelReaderWriterBuildable(typeof(SubResource))] + [ModelReaderWriterBuildable(typeof(Models.SubResource))] + [ModelReaderWriterBuildable(typeof(Azure.ResourceManager.Resources.Models.SubResource))] [ModelReaderWriterBuildable(typeof(SubResourceReadOnly))] [ModelReaderWriterBuildable(typeof(SubResourceWithColocationStatus))] [ModelReaderWriterBuildable(typeof(SubscriptionResourceGetVirtualMachineImagesOptions))] @@ -103,6 +107,7 @@ namespace AzureSample.ResourceManager.Sample [ModelReaderWriterBuildable(typeof(UpgradeOperationHistoricalStatusInfoProperties))] [ModelReaderWriterBuildable(typeof(UpgradeOperationHistoryStatus))] [ModelReaderWriterBuildable(typeof(UpgradePolicy))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] [ModelReaderWriterBuildable(typeof(VaultCertificate))] [ModelReaderWriterBuildable(typeof(VaultSecretGroup))] [ModelReaderWriterBuildable(typeof(VirtualMachineAgentInstanceView))] @@ -179,6 +184,7 @@ namespace AzureSample.ResourceManager.Sample [ModelReaderWriterBuildable(typeof(VmScaleSetConvertToSinglePlacementGroupContent))] [ModelReaderWriterBuildable(typeof(WindowsConfiguration))] [ModelReaderWriterBuildable(typeof(WinRMListener))] + [ModelReaderWriterBuildable(typeof(WritableSubResource))] public partial class AzureSampleResourceManagerSampleContext : ModelReaderWriterContext { } diff --git a/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs b/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs index 441cbe8c30d..c8edd7b70df 100644 --- a/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs +++ b/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs @@ -157,6 +157,12 @@ private bool ImplementsIPersistableModel(CSharpType type, Dictionary + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(User))] [ModelReaderWriterBuildable(typeof(UserList))] [ModelReaderWriterBuildable(typeof(UserOrder))] diff --git a/test/CadlRanchProjects/azure/core/lro/rpc/src/Generated/Models/_AzureLroRpcContext.cs b/test/CadlRanchProjects/azure/core/lro/rpc/src/Generated/Models/_AzureLroRpcContext.cs index 92ba5759636..ace4c49d708 100644 --- a/test/CadlRanchProjects/azure/core/lro/rpc/src/Generated/Models/_AzureLroRpcContext.cs +++ b/test/CadlRanchProjects/azure/core/lro/rpc/src/Generated/Models/_AzureLroRpcContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using _Azure.Lro.Rpc.Models; namespace _Azure.Lro.Rpc @@ -16,6 +17,7 @@ namespace _Azure.Lro.Rpc /// [ModelReaderWriterBuildable(typeof(GenerationOptions))] [ModelReaderWriterBuildable(typeof(GenerationResult))] + [ModelReaderWriterBuildable(typeof(ResponseError))] public partial class _AzureLroRpcContext : ModelReaderWriterContext { } diff --git a/test/CadlRanchProjects/azure/core/lro/standard/src/Generated/Models/_AzureLroStandardContext.cs b/test/CadlRanchProjects/azure/core/lro/standard/src/Generated/Models/_AzureLroStandardContext.cs index d6b478ef4d4..99c1e707581 100644 --- a/test/CadlRanchProjects/azure/core/lro/standard/src/Generated/Models/_AzureLroStandardContext.cs +++ b/test/CadlRanchProjects/azure/core/lro/standard/src/Generated/Models/_AzureLroStandardContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using _Azure.Lro.Standard.Models; namespace _Azure.Lro.Standard @@ -15,6 +16,7 @@ namespace _Azure.Lro.Standard /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// [ModelReaderWriterBuildable(typeof(ExportedUser))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(User))] public partial class _AzureLroStandardContext : ModelReaderWriterContext { diff --git a/test/CadlRanchProjects/azure/core/page/src/Generated/Models/_Specs_AzureCorePageContext.cs b/test/CadlRanchProjects/azure/core/page/src/Generated/Models/_Specs_AzureCorePageContext.cs index c15bae014f6..54af84f6fdc 100644 --- a/test/CadlRanchProjects/azure/core/page/src/Generated/Models/_Specs_AzureCorePageContext.cs +++ b/test/CadlRanchProjects/azure/core/page/src/Generated/Models/_Specs_AzureCorePageContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using _Specs_.Azure.Core.Page.Models; namespace _Specs_.Azure.Core.Page @@ -16,6 +17,7 @@ namespace _Specs_.Azure.Core.Page /// [ModelReaderWriterBuildable(typeof(FirstItem))] [ModelReaderWriterBuildable(typeof(ListItemInputBody))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SecondItem))] [ModelReaderWriterBuildable(typeof(User))] [ModelReaderWriterBuildable(typeof(UserOrder))] diff --git a/test/CadlRanchProjects/azure/core/traits/src/Generated/Models/_Specs_AzureCoreTraitsContext.cs b/test/CadlRanchProjects/azure/core/traits/src/Generated/Models/_Specs_AzureCoreTraitsContext.cs index 013fc7d7a10..4b05a0f209e 100644 --- a/test/CadlRanchProjects/azure/core/traits/src/Generated/Models/_Specs_AzureCoreTraitsContext.cs +++ b/test/CadlRanchProjects/azure/core/traits/src/Generated/Models/_Specs_AzureCoreTraitsContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using _Specs_.Azure.Core.Traits.Models; namespace _Specs_.Azure.Core.Traits @@ -14,6 +15,7 @@ namespace _Specs_.Azure.Core.Traits /// Context class which will be filled in by the System.ClientModel.SourceGeneration. /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(User))] [ModelReaderWriterBuildable(typeof(UserActionParam))] [ModelReaderWriterBuildable(typeof(UserActionResponse))] diff --git a/test/CadlRanchProjects/azure/resource-manager/common-properties/src/Generated/Models/_AzureResourceManagerCommonPropertiesContext.cs b/test/CadlRanchProjects/azure/resource-manager/common-properties/src/Generated/Models/_AzureResourceManagerCommonPropertiesContext.cs index cdd0b2bb040..7809bbf7b2e 100644 --- a/test/CadlRanchProjects/azure/resource-manager/common-properties/src/Generated/Models/_AzureResourceManagerCommonPropertiesContext.cs +++ b/test/CadlRanchProjects/azure/resource-manager/common-properties/src/Generated/Models/_AzureResourceManagerCommonPropertiesContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; using _Azure.ResourceManager.CommonProperties.Models; @@ -20,7 +21,10 @@ namespace _Azure.ResourceManager.CommonProperties [ModelReaderWriterBuildable(typeof(ConfidentialResourceProperties))] [ModelReaderWriterBuildable(typeof(ManagedIdentityTrackedResource))] [ModelReaderWriterBuildable(typeof(ManagedIdentityTrackedResourceData))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SystemData))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] public partial class _AzureResourceManagerCommonPropertiesContext : ModelReaderWriterContext { } diff --git a/test/CadlRanchProjects/azure/resource-manager/non-resource/src/Generated/Models/_AzureResourceManagerNonResourcesContext.cs b/test/CadlRanchProjects/azure/resource-manager/non-resource/src/Generated/Models/_AzureResourceManagerNonResourcesContext.cs index b45995fc4e0..6b0b9680592 100644 --- a/test/CadlRanchProjects/azure/resource-manager/non-resource/src/Generated/Models/_AzureResourceManagerNonResourcesContext.cs +++ b/test/CadlRanchProjects/azure/resource-manager/non-resource/src/Generated/Models/_AzureResourceManagerNonResourcesContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using _Azure.ResourceManager.NonResources.Models; namespace _Azure.ResourceManager.NonResources @@ -15,6 +16,7 @@ namespace _Azure.ResourceManager.NonResources /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// [ModelReaderWriterBuildable(typeof(NonResource))] + [ModelReaderWriterBuildable(typeof(ResponseError))] public partial class _AzureResourceManagerNonResourcesContext : ModelReaderWriterContext { } diff --git a/test/CadlRanchProjects/azure/resource-manager/resources/src/Generated/Models/_AzureResourceManagerResourcesContext.cs b/test/CadlRanchProjects/azure/resource-manager/resources/src/Generated/Models/_AzureResourceManagerResourcesContext.cs index 9d6cc560aee..2c2bbf76564 100644 --- a/test/CadlRanchProjects/azure/resource-manager/resources/src/Generated/Models/_AzureResourceManagerResourcesContext.cs +++ b/test/CadlRanchProjects/azure/resource-manager/resources/src/Generated/Models/_AzureResourceManagerResourcesContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; using _Azure.ResourceManager.Resources.Models; @@ -25,6 +26,7 @@ namespace _Azure.ResourceManager.Resources [ModelReaderWriterBuildable(typeof(NestedProxyResourceData))] [ModelReaderWriterBuildable(typeof(NestedProxyResourceProperties))] [ModelReaderWriterBuildable(typeof(NotificationDetails))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SingletonTrackedResource))] [ModelReaderWriterBuildable(typeof(SingletonTrackedResourceData))] [ModelReaderWriterBuildable(typeof(SingletonTrackedResourceProperties))] diff --git a/test/TestProjects/Authoring-TypeSpec/src/Generated/Models/AuthoringTypeSpecContext.cs b/test/TestProjects/Authoring-TypeSpec/src/Generated/Models/AuthoringTypeSpecContext.cs index fbb138d8772..26ce9bb07df 100644 --- a/test/TestProjects/Authoring-TypeSpec/src/Generated/Models/AuthoringTypeSpecContext.cs +++ b/test/TestProjects/Authoring-TypeSpec/src/Generated/Models/AuthoringTypeSpecContext.cs @@ -7,6 +7,7 @@ using System.ClientModel.Primitives; using AuthoringTypeSpec.Models; +using Azure; namespace AuthoringTypeSpec { @@ -16,6 +17,7 @@ namespace AuthoringTypeSpec /// [ModelReaderWriterBuildable(typeof(DeploymentJob))] [ModelReaderWriterBuildable(typeof(JobWarning))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SwapDeploymentsJob))] public partial class AuthoringTypeSpecContext : ModelReaderWriterContext { diff --git a/test/TestProjects/FirstTest-TypeSpec/src/Generated/Models/FirstTestTypeSpecContext.cs b/test/TestProjects/FirstTest-TypeSpec/src/Generated/Models/FirstTestTypeSpecContext.cs index 0b98eafedb1..193f5af5187 100644 --- a/test/TestProjects/FirstTest-TypeSpec/src/Generated/Models/FirstTestTypeSpecContext.cs +++ b/test/TestProjects/FirstTest-TypeSpec/src/Generated/Models/FirstTestTypeSpecContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using FirstTestTypeSpec.Models; namespace FirstTestTypeSpec @@ -29,6 +30,7 @@ namespace FirstTestTypeSpec [ModelReaderWriterBuildable(typeof(ModelWithProjectedEnum))] [ModelReaderWriterBuildable(typeof(ModelWithRequiredNullableProperties))] [ModelReaderWriterBuildable(typeof(ProjectedModel))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(ReturnsAnonymousModelResponse))] [ModelReaderWriterBuildable(typeof(RoundTripModel))] [ModelReaderWriterBuildable(typeof(ThereLevelElement))] diff --git a/test/TestProjects/MgmtCustomizations/src/Generated/Models/MgmtCustomizationsContext.cs b/test/TestProjects/MgmtCustomizations/src/Generated/Models/MgmtCustomizationsContext.cs index 0a8ff863522..8e075f75b6a 100644 --- a/test/TestProjects/MgmtCustomizations/src/Generated/Models/MgmtCustomizationsContext.cs +++ b/test/TestProjects/MgmtCustomizations/src/Generated/Models/MgmtCustomizationsContext.cs @@ -6,6 +6,7 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; using MgmtCustomizations.Models; @@ -21,6 +22,7 @@ namespace MgmtCustomizations [ModelReaderWriterBuildable(typeof(PetStoreData))] [ModelReaderWriterBuildable(typeof(PetStoreProperties))] [ModelReaderWriterBuildable(typeof(PetStoreResource))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SystemData))] [ModelReaderWriterBuildable(typeof(UnknownPet))] public partial class MgmtCustomizationsContext : ModelReaderWriterContext diff --git a/test/TestProjects/MgmtDiscriminator/src/Generated/Models/MgmtDiscriminatorContext.cs b/test/TestProjects/MgmtDiscriminator/src/Generated/Models/MgmtDiscriminatorContext.cs index 5c764aabdff..ee8ad29f442 100644 --- a/test/TestProjects/MgmtDiscriminator/src/Generated/Models/MgmtDiscriminatorContext.cs +++ b/test/TestProjects/MgmtDiscriminator/src/Generated/Models/MgmtDiscriminatorContext.cs @@ -6,7 +6,9 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; using MgmtDiscriminator.Models; namespace MgmtDiscriminator @@ -45,6 +47,7 @@ namespace MgmtDiscriminator [ModelReaderWriterBuildable(typeof(QueryStringMatchConditionParameters))] [ModelReaderWriterBuildable(typeof(RemoteAddressMatchConditionParameters))] [ModelReaderWriterBuildable(typeof(RequestMethodMatchConditionParameters))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(RoleAssignmentArtifact))] [ModelReaderWriterBuildable(typeof(RouteConfigurationOverrideActionParameters))] [ModelReaderWriterBuildable(typeof(Shell))] @@ -62,6 +65,7 @@ namespace MgmtDiscriminator [ModelReaderWriterBuildable(typeof(UrlSigningAction))] [ModelReaderWriterBuildable(typeof(UrlSigningActionParameters))] [ModelReaderWriterBuildable(typeof(UrlSigningParamIdentifier))] + [ModelReaderWriterBuildable(typeof(WritableSubResource))] public partial class MgmtDiscriminatorContext : ModelReaderWriterContext { } diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/Models/MgmtTypeSpecContext.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/Models/MgmtTypeSpecContext.cs index 45906b1be41..15786a4bfc7 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/Models/MgmtTypeSpecContext.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/Models/MgmtTypeSpecContext.cs @@ -6,7 +6,9 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; using MgmtTypeSpec.Models; namespace MgmtTypeSpec @@ -15,14 +17,18 @@ namespace MgmtTypeSpec /// Context class which will be filled in by the System.ClientModel.SourceGeneration. /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// + [ModelReaderWriterBuildable(typeof(ExtendedLocation))] [ModelReaderWriterBuildable(typeof(FooData))] [ModelReaderWriterBuildable(typeof(FooProperties))] [ModelReaderWriterBuildable(typeof(FooResource))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] [ModelReaderWriterBuildable(typeof(MgmtTypeSpecPrivateLinkResourceData))] [ModelReaderWriterBuildable(typeof(MgmtTypeSpecPrivateLinkResourceProperties))] [ModelReaderWriterBuildable(typeof(Models.OperationStatusResult))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(StartContent))] [ModelReaderWriterBuildable(typeof(SystemData))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] public partial class MgmtTypeSpecContext : ModelReaderWriterContext { }