Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine mgmt reference type #43991

Merged
merged 2 commits into from
May 11, 2024
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 4 additions & 21 deletions sdk/resourcemanager/Azure.ResourceManager/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,36 @@ 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";
$["x-csharp-usage"] = "model,input,output";
- from: types.json
where: $.definitions.Sku
transform: >
$["x-ms-mgmt-propertyReferenceType"] = true;
$["x-namespace"] = "Azure.ResourceManager.Models";
$["x-accessibility"] = "public";
$["x-csharp-formats"] = "json";
$["x-csharp-usage"] = "model,input,output";
- from: types.json
where: $.definitions.systemData
transform: >
$["x-ms-mgmt-propertyReferenceType"] = true;
$["x-namespace"] = "Azure.ResourceManager.Models";
$["x-accessibility"] = "public";
$["x-csharp-formats"] = "json";
Expand All @@ -119,15 +114,13 @@ 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";
$["x-csharp-usage"] = "model,input,output";
- from: types.json
where: $.definitions.KeyVaultProperties
transform: >
$["x-ms-mgmt-propertyReferenceType"] = true;
$["x-namespace"] = "Azure.ResourceManager.Models";
$["x-accessibility"] = "public";
$["x-csharp-formats"] = "json";
Expand All @@ -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
Expand All @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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"
Expand Down