Skip to content

Commit b3b6c8a

Browse files
authored
remove custom code for ResourceData (Azure#43991)
1 parent d515bc8 commit b3b6c8a

File tree

3 files changed

+22
-39
lines changed

3 files changed

+22
-39
lines changed

sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/ResourceData.cs renamed to sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.cs

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resourcemanager/Azure.ResourceManager/src/Common/Custom/Models/TrackedResourceData.cs renamed to sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.cs

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resourcemanager/Azure.ResourceManager/src/autorest.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,41 +72,36 @@ directive:
7272
- from: types.json
7373
where: $.definitions.Resource
7474
transform: >
75-
$["x-ms-mgmt-referenceType"] = true;
76-
$["x-ms-mgmt-propertyReferenceType"] = true;
7775
$["x-namespace"] = "Azure.ResourceManager.Models";
76+
$["x-ms-client-name"] = "ResourceData";
7877
$["x-accessibility"] = "public";
7978
$["x-csharp-formats"] = "json";
8079
$["x-csharp-usage"] = "model,input,output";
8180
- from: types.json
8281
where: $.definitions.TrackedResource
8382
transform: >
84-
$["x-ms-mgmt-referenceType"] = true;
85-
$["x-ms-mgmt-propertyReferenceType"] = true;
8683
$["x-namespace"] = "Azure.ResourceManager.Models";
84+
$["x-ms-client-name"] = "TrackedResourceData";
8785
$["x-accessibility"] = "public";
8886
$["x-csharp-formats"] = "json";
8987
$["x-csharp-usage"] = "model,input,output";
9088
- from: types.json
9189
where: $.definitions.Plan
9290
transform: >
93-
$["x-ms-mgmt-propertyReferenceType"] = true;
9491
$["x-namespace"] = "Azure.ResourceManager.Models";
9592
$["x-accessibility"] = "public";
9693
$["x-csharp-formats"] = "json";
9794
$["x-csharp-usage"] = "model,input,output";
9895
- from: types.json
9996
where: $.definitions.Sku
10097
transform: >
101-
$["x-ms-mgmt-propertyReferenceType"] = true;
10298
$["x-namespace"] = "Azure.ResourceManager.Models";
10399
$["x-accessibility"] = "public";
104100
$["x-csharp-formats"] = "json";
105101
$["x-csharp-usage"] = "model,input,output";
106102
- from: types.json
107103
where: $.definitions.systemData
108104
transform: >
109-
$["x-ms-mgmt-propertyReferenceType"] = true;
110105
$["x-namespace"] = "Azure.ResourceManager.Models";
111106
$["x-accessibility"] = "public";
112107
$["x-csharp-formats"] = "json";
@@ -119,15 +114,13 @@ directive:
119114
- from: types.json
120115
where: $.definitions.encryptionProperties
121116
transform: >
122-
$["x-ms-mgmt-propertyReferenceType"] = true;
123117
$["x-namespace"] = "Azure.ResourceManager.Models";
124118
$["x-accessibility"] = "public";
125119
$["x-csharp-formats"] = "json";
126120
$["x-csharp-usage"] = "model,input,output";
127121
- from: types.json
128122
where: $.definitions.KeyVaultProperties
129123
transform: >
130-
$["x-ms-mgmt-propertyReferenceType"] = true;
131124
$["x-namespace"] = "Azure.ResourceManager.Models";
132125
$["x-accessibility"] = "public";
133126
$["x-csharp-formats"] = "json";
@@ -140,8 +133,6 @@ directive:
140133
- from: types.json
141134
where: $.definitions.OperationStatusResult
142135
transform: >
143-
$["x-ms-mgmt-propertyReferenceType"] = false;
144-
$["x-ms-mgmt-typeReferenceType"] = true;
145136
$["x-csharp-formats"] = "json";
146137
$["x-csharp-usage"] = "model,input,output";
147138
- from: types.json
@@ -151,7 +142,6 @@ directive:
151142
- from: managedidentity.json
152143
where: $.definitions.SystemAssignedServiceIdentity
153144
transform: >
154-
$["x-ms-mgmt-propertyReferenceType"] = true;
155145
$["x-namespace"] = "Azure.ResourceManager.Models";
156146
$["x-accessibility"] = "public";
157147
$["x-csharp-formats"] = "json";
@@ -160,7 +150,6 @@ directive:
160150
- from: managedidentity.json
161151
where: $.definitions.UserAssignedIdentity
162152
transform: >
163-
$["x-ms-mgmt-propertyReferenceType"] = true;
164153
$["x-namespace"] = "Azure.ResourceManager.Models";
165154
$["x-accessibility"] = "public";
166155
$["x-csharp-formats"] = "json";
@@ -302,6 +291,8 @@ rename-mapping:
302291
ResourceName: ResourceNameValidationContent
303292
ResourceName.type: ResourceType|resource-type
304293
ResourceNameStatus: ResourceNameValidationStatus
294+
Resource: ResourceData
295+
TrackedResource: TrackedResourceData
305296
306297
directive:
307298
# These methods can be replaced by using other methods in the same operation group, remove for Preview.
@@ -332,10 +323,6 @@ directive:
332323
- remove-operation: Providers_RegisterAtManagementGroupScope
333324
- remove-operation: Subscriptions_CheckZonePeers
334325
- remove-operation: AuthorizationOperations_List
335-
- from: swagger-document
336-
where: $.definitions.ExtendedLocation
337-
transform: >
338-
$["x-ms-mgmt-propertyReferenceType"] = true;
339326
# Deduplicate
340327
- from: subscriptions.json
341328
where: '$.paths["/providers/Microsoft.Resources/operations"].get'
@@ -593,10 +580,6 @@ directive:
593580
$.GenericResource.properties["changedTime"] = $.GenericResourceExpanded.properties["changedTime"];
594581
$.GenericResource.properties["provisioningState"] = $.GenericResourceExpanded.properties["provisioningState"];
595582
delete $.GenericResourceExpanded;
596-
# - from: resources.json
597-
# where: $.definitions['Provider']
598-
# transform: >
599-
# $["x-ms-mgmt-propertyReferenceType"] = true # not supported with ResourceData yet, use custom code first
600583
- from: locks.json
601584
where: $.definitions.ManagementLockObject
602585
transform: $["x-ms-client-name"] = "ManagementLock"

0 commit comments

Comments
 (0)