Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))]
Expand All @@ -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))]
Expand All @@ -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))]
Expand All @@ -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))]
Expand Down Expand Up @@ -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
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ private bool ImplementsIPersistableModel(CSharpType type, Dictionary<CSharpType,
return true;
}

// If the type is SystemObjectType, it should always implement IPersistableModel or IJsonModel
if (!type.IsFrameworkType && type.Implementation is SystemObjectType)
{
return true;
}

if (!type.IsFrameworkType || type.IsEnum || type.IsLiteral)
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Specs_.Azure.Core.Basic.Models;

namespace _Specs_.Azure.Core.Basic
Expand All @@ -14,6 +15,7 @@ namespace _Specs_.Azure.Core.Basic
/// 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'
/// </summary>
[ModelReaderWriterBuildable(typeof(ResponseError))]
[ModelReaderWriterBuildable(typeof(User))]
[ModelReaderWriterBuildable(typeof(UserList))]
[ModelReaderWriterBuildable(typeof(UserOrder))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Azure.Lro.Rpc.Models;

namespace _Azure.Lro.Rpc
Expand All @@ -16,6 +17,7 @@ namespace _Azure.Lro.Rpc
/// </summary>
[ModelReaderWriterBuildable(typeof(GenerationOptions))]
[ModelReaderWriterBuildable(typeof(GenerationResult))]
[ModelReaderWriterBuildable(typeof(ResponseError))]
public partial class _AzureLroRpcContext : ModelReaderWriterContext
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Azure.Lro.Standard.Models;

namespace _Azure.Lro.Standard
Expand All @@ -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'
/// </summary>
[ModelReaderWriterBuildable(typeof(ExportedUser))]
[ModelReaderWriterBuildable(typeof(ResponseError))]
[ModelReaderWriterBuildable(typeof(User))]
public partial class _AzureLroStandardContext : ModelReaderWriterContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Specs_.Azure.Core.Page.Models;

namespace _Specs_.Azure.Core.Page
Expand All @@ -16,6 +17,7 @@ namespace _Specs_.Azure.Core.Page
/// </summary>
[ModelReaderWriterBuildable(typeof(FirstItem))]
[ModelReaderWriterBuildable(typeof(ListItemInputBody))]
[ModelReaderWriterBuildable(typeof(ResponseError))]
[ModelReaderWriterBuildable(typeof(SecondItem))]
[ModelReaderWriterBuildable(typeof(User))]
[ModelReaderWriterBuildable(typeof(UserOrder))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Specs_.Azure.Core.Traits.Models;

namespace _Specs_.Azure.Core.Traits
Expand All @@ -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'
/// </summary>
[ModelReaderWriterBuildable(typeof(ResponseError))]
[ModelReaderWriterBuildable(typeof(User))]
[ModelReaderWriterBuildable(typeof(UserActionParam))]
[ModelReaderWriterBuildable(typeof(UserActionResponse))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using Azure.ResourceManager.Models;
using _Azure.ResourceManager.CommonProperties.Models;

Expand All @@ -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
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using _Azure.ResourceManager.NonResources.Models;

namespace _Azure.ResourceManager.NonResources
Expand All @@ -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'
/// </summary>
[ModelReaderWriterBuildable(typeof(NonResource))]
[ModelReaderWriterBuildable(typeof(ResponseError))]
public partial class _AzureResourceManagerNonResourcesContext : ModelReaderWriterContext
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using Azure.ResourceManager.Models;
using _Azure.ResourceManager.Resources.Models;

Expand All @@ -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))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System.ClientModel.Primitives;
using AuthoringTypeSpec.Models;
using Azure;

namespace AuthoringTypeSpec
{
Expand All @@ -16,6 +17,7 @@ namespace AuthoringTypeSpec
/// </summary>
[ModelReaderWriterBuildable(typeof(DeploymentJob))]
[ModelReaderWriterBuildable(typeof(JobWarning))]
[ModelReaderWriterBuildable(typeof(ResponseError))]
[ModelReaderWriterBuildable(typeof(SwapDeploymentsJob))]
public partial class AuthoringTypeSpecContext : ModelReaderWriterContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using FirstTestTypeSpec.Models;

namespace FirstTestTypeSpec
Expand All @@ -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))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#nullable disable

using System.ClientModel.Primitives;
using Azure;
using Azure.ResourceManager.Models;
using MgmtCustomizations.Models;

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))]
Expand All @@ -62,6 +65,7 @@ namespace MgmtDiscriminator
[ModelReaderWriterBuildable(typeof(UrlSigningAction))]
[ModelReaderWriterBuildable(typeof(UrlSigningActionParameters))]
[ModelReaderWriterBuildable(typeof(UrlSigningParamIdentifier))]
[ModelReaderWriterBuildable(typeof(WritableSubResource))]
public partial class MgmtDiscriminatorContext : ModelReaderWriterContext
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
/// </summary>
[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
{
}
Expand Down