diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/ResourceData.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.cs similarity index 77% rename from sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/ResourceData.cs rename to sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.cs index 7f9781ad3109..841b931f4459 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/ResourceData.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.cs @@ -1,27 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// + #nullable disable using Azure.Core; -[assembly: CodeGenSuppressType("ArmResourceData")] namespace Azure.ResourceManager.Models { /// Common fields that are returned in the response for all Azure Resource Manager resources. - [ReferenceType(new string[]{"SystemData"})] + [ReferenceType(new string[] { "SystemData" })] public abstract partial class ResourceData { - /// Initializes a new instance of Resource. + /// Initializes a new instance of . [InitializationConstructor] protected ResourceData() { } - /// Initializes a new instance of Resource. + /// Initializes a new instance of . /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". /// Azure Resource Manager metadata containing createdBy and modifiedBy information. [SerializationConstructor] protected ResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData) @@ -36,7 +37,7 @@ protected ResourceData(ResourceIdentifier id, string name, ResourceType resource public ResourceIdentifier Id { get; } /// The name of the resource. public string Name { get; } - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". public ResourceType ResourceType { get; } /// Azure Resource Manager metadata containing createdBy and modifiedBy information. public SystemData SystemData { get; } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/TrackedResourceData.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.cs similarity index 56% rename from sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/TrackedResourceData.cs rename to sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.cs index 7b533848633a..741469301da7 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/TrackedResourceData.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.cs @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// + #nullable disable using System.Collections.Generic; using Azure.Core; -[assembly: CodeGenSuppressType("TrackedResource")] namespace Azure.ResourceManager.Models { - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - [ReferenceType(new string[]{"SystemData"})] + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + [ReferenceType(new string[] { "SystemData" })] public abstract partial class TrackedResourceData : ResourceData { - /// Initializes a new instance of TrackedResource. + /// Initializes a new instance of . /// The geo-location where the resource lives. [InitializationConstructor] protected TrackedResourceData(AzureLocation location) @@ -22,11 +23,11 @@ protected TrackedResourceData(AzureLocation location) Location = location; } - /// Initializes a new instance of TrackedResource. - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - /// The name of the resource. - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. /// Resource tags. /// The geo-location where the resource lives. [SerializationConstructor] @@ -36,9 +37,7 @@ protected TrackedResourceData(ResourceIdentifier id, string name, ResourceType r Location = location; } - /// - /// Initializes a new instance of for deserialization. - /// + /// Initializes a new instance of for deserialization. protected TrackedResourceData() { } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md index 84df38f95d5a..e09d55ab8512 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md +++ b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md @@ -72,25 +72,22 @@ directive: - from: types.json where: $.definitions.Resource transform: > - $["x-ms-mgmt-referenceType"] = true; - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; + $["x-ms-client-name"] = "ResourceData"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; $["x-csharp-usage"] = "model,input,output"; - from: types.json where: $.definitions.TrackedResource transform: > - $["x-ms-mgmt-referenceType"] = true; - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; + $["x-ms-client-name"] = "TrackedResourceData"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; $["x-csharp-usage"] = "model,input,output"; - from: types.json where: $.definitions.Plan transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -98,7 +95,6 @@ directive: - from: types.json where: $.definitions.Sku transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -106,7 +102,6 @@ directive: - from: types.json where: $.definitions.systemData transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -119,7 +114,6 @@ directive: - from: types.json where: $.definitions.encryptionProperties transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -127,7 +121,6 @@ directive: - from: types.json where: $.definitions.KeyVaultProperties transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -140,8 +133,6 @@ directive: - from: types.json where: $.definitions.OperationStatusResult transform: > - $["x-ms-mgmt-propertyReferenceType"] = false; - $["x-ms-mgmt-typeReferenceType"] = true; $["x-csharp-formats"] = "json"; $["x-csharp-usage"] = "model,input,output"; - from: types.json @@ -151,7 +142,6 @@ directive: - from: managedidentity.json where: $.definitions.SystemAssignedServiceIdentity transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -160,7 +150,6 @@ directive: - from: managedidentity.json where: $.definitions.UserAssignedIdentity transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; $["x-namespace"] = "Azure.ResourceManager.Models"; $["x-accessibility"] = "public"; $["x-csharp-formats"] = "json"; @@ -302,6 +291,8 @@ rename-mapping: ResourceName: ResourceNameValidationContent ResourceName.type: ResourceType|resource-type ResourceNameStatus: ResourceNameValidationStatus + Resource: ResourceData + TrackedResource: TrackedResourceData directive: # These methods can be replaced by using other methods in the same operation group, remove for Preview. @@ -332,10 +323,6 @@ directive: - remove-operation: Providers_RegisterAtManagementGroupScope - remove-operation: Subscriptions_CheckZonePeers - remove-operation: AuthorizationOperations_List - - from: swagger-document - where: $.definitions.ExtendedLocation - transform: > - $["x-ms-mgmt-propertyReferenceType"] = true; # Deduplicate - from: subscriptions.json where: '$.paths["/providers/Microsoft.Resources/operations"].get' @@ -593,10 +580,6 @@ directive: $.GenericResource.properties["changedTime"] = $.GenericResourceExpanded.properties["changedTime"]; $.GenericResource.properties["provisioningState"] = $.GenericResourceExpanded.properties["provisioningState"]; delete $.GenericResourceExpanded; -# - from: resources.json -# where: $.definitions['Provider'] -# transform: > -# $["x-ms-mgmt-propertyReferenceType"] = true # not supported with ResourceData yet, use custom code first - from: locks.json where: $.definitions.ManagementLockObject transform: $["x-ms-client-name"] = "ManagementLock"