Skip to content

Commit 56d1821

Browse files
Fixed merge conflicts, added 2 fixes to processor
2 parents 2ef61cb + febc3bb commit 56d1821

File tree

62 files changed

+70735
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+70735
-242
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate Types
1+
name: Generate Schemas
22

33
on:
44
workflow_dispatch:
@@ -12,8 +12,8 @@ on:
1212
required: false
1313

1414
jobs:
15-
update-types:
16-
name: Update Types
15+
update-schemas:
16+
name: Update Schemas
1717
runs-on: ubuntu-latest
1818

1919
steps:

generator/autogenlist.ts

Lines changed: 82 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ const disabledProviders: AutoGenConfig[] = [
8888
namespace: 'Microsoft.Media',
8989
disabledForAutogen: true,
9090
},
91-
// Disabled because the swagger spec contains duplicate API paths and results in schema generation failures, see here for more info: https://github.com/Azure/azure-resource-manager-schemas/issues/2462
9291
{
93-
basePath: 'authorization/resource-manager',
94-
namespace: 'Microsoft.Authorization',
92+
// Disabled as the swagger spec contains a bug (enum mismatch)
93+
basePath: 'servicefabricmesh/resource-manager',
94+
namespace: 'Microsoft.ServiceFabricMesh',
9595
disabledForAutogen: true,
9696
}
9797
];
@@ -103,6 +103,53 @@ const autoGenList: AutoGenConfig[] = [
103103
basePath: 'addons/resource-manager',
104104
namespace: 'Microsoft.Addons',
105105
},
106+
{
107+
basePath: 'authorization/resource-manager',
108+
namespace: 'Microsoft.Authorization',
109+
resourceConfig: [
110+
{
111+
type: 'roleAssignments',
112+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
113+
},
114+
{
115+
type: 'roleDefinitions',
116+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
117+
},
118+
{
119+
type: 'roleAssignmentScheduleRequests',
120+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
121+
},
122+
{
123+
type: 'roleEligibilityScheduleRequests',
124+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
125+
},
126+
{
127+
type: 'roleManagementPolicyAssignments',
128+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
129+
},
130+
{
131+
type: 'roleAssignmentApprovals/stages',
132+
scopes: ScopeType.Tenant
133+
},
134+
{
135+
type: 'accessReviewHistoryDefinitions',
136+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
137+
},
138+
{
139+
type: 'accessReviewScheduleDefinitions',
140+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
141+
},
142+
{
143+
type: 'accessReviewScheduleDefinitions/instances',
144+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
145+
},
146+
{
147+
type: 'accessReviewScheduleSettings',
148+
scopes: ScopeType.Extension | ScopeType.ManagementGroup | ScopeType.ResourceGroup | ScopeType.Subscription | ScopeType.Tenant
149+
},
150+
],
151+
suffix: 'Authz'
152+
},
106153
{
107154
basePath: 'adhybridhealthservice/resource-manager',
108155
namespace: 'Microsoft.ADHybridHealthService',
@@ -173,19 +220,19 @@ const autoGenList: AutoGenConfig[] = [
173220
resourceConfig: [
174221
{
175222
type: 'blueprintAssignments',
176-
scopes: ScopeType.Subcription | ScopeType.ManagementGroup,
223+
scopes: ScopeType.Subscription | ScopeType.ManagementGroup,
177224
},
178225
{
179226
type: 'blueprints',
180-
scopes: ScopeType.Subcription | ScopeType.ManagementGroup,
227+
scopes: ScopeType.Subscription | ScopeType.ManagementGroup,
181228
},
182229
{
183230
type: 'blueprints/artifacts',
184-
scopes: ScopeType.Subcription | ScopeType.ManagementGroup,
231+
scopes: ScopeType.Subscription | ScopeType.ManagementGroup,
185232
},
186233
{
187234
type: 'blueprints/versions',
188-
scopes: ScopeType.Subcription | ScopeType.ManagementGroup,
235+
scopes: ScopeType.Subscription | ScopeType.ManagementGroup,
189236
},
190237
]
191238
},
@@ -245,7 +292,7 @@ const autoGenList: AutoGenConfig[] = [
245292
resourceConfig: [
246293
{
247294
type: 'budgets',
248-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
295+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
249296
},
250297
],
251298
},
@@ -255,15 +302,15 @@ const autoGenList: AutoGenConfig[] = [
255302
resourceConfig: [
256303
{
257304
type: 'exports',
258-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup,
305+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup,
259306
},
260307
{
261308
type: 'budgets',
262-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
309+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
263310
},
264311
{
265312
type: 'views',
266-
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
313+
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
267314
},
268315
],
269316
postProcessor: costManagementPostProcessor,
@@ -455,7 +502,7 @@ const autoGenList: AutoGenConfig[] = [
455502
resourceConfig: [
456503
{
457504
type: 'eventSubscriptions',
458-
scopes: ScopeType.Extension | ScopeType.Subcription | ScopeType.ResourceGroup,
505+
scopes: ScopeType.Extension | ScopeType.Subscription | ScopeType.ResourceGroup,
459506
},
460507
],
461508
},
@@ -501,7 +548,7 @@ const autoGenList: AutoGenConfig[] = [
501548
resourceConfig: [
502549
{
503550
type: 'scopeAssignments',
504-
scopes: ScopeType.Subcription,
551+
scopes: ScopeType.Subscription,
505552
},
506553
],
507554
},
@@ -557,11 +604,11 @@ const autoGenList: AutoGenConfig[] = [
557604
resourceConfig: [
558605
{
559606
type: 'remediations',
560-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
607+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.ManagementGroup,
561608
},
562609
{
563610
type: 'attestations',
564-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup,
611+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup,
565612
}
566613
]
567614
},
@@ -614,11 +661,11 @@ const autoGenList: AutoGenConfig[] = [
614661
resourceConfig: [
615662
{
616663
type: 'deployments',
617-
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup,
664+
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup,
618665
},
619666
{
620667
type: 'tags',
621-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
668+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
622669
},
623670
],
624671
postProcessor: resourcesPostProcessor,
@@ -629,27 +676,27 @@ const autoGenList: AutoGenConfig[] = [
629676
resourceConfig: [
630677
{
631678
type: 'policyDefinitions',
632-
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subcription,
679+
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subscription,
633680
},
634681
{
635682
type: 'policySetDefinitions',
636-
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subcription,
683+
scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subscription,
637684
},
638685
{
639686
type: 'policyAssignments',
640-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
687+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
641688
},
642689
{
643690
type: 'policyExemptions',
644-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
691+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
645692
},
646693
{
647694
type: 'policyPricings',
648-
scopes: ScopeType.ManagementGroup | ScopeType.Subcription,
695+
scopes: ScopeType.ManagementGroup | ScopeType.Subscription,
649696
},
650697
{
651698
type: 'locks',
652-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
699+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
653700
},
654701
],
655702
suffix: 'Resources',
@@ -685,10 +732,6 @@ const autoGenList: AutoGenConfig[] = [
685732
basePath: 'servicefabric/resource-manager',
686733
namespace: 'Microsoft.ServiceFabric',
687734
},
688-
{
689-
basePath: 'servicefabricmesh/resource-manager',
690-
namespace: 'Microsoft.ServiceFabricMesh',
691-
},
692735
{
693736
basePath: 'servicelinker/resource-manager',
694737
namespace: 'Microsoft.ServiceLinker',
@@ -742,19 +785,19 @@ const autoGenList: AutoGenConfig[] = [
742785
resourceConfig: [
743786
{
744787
type: 'advancedThreatProtectionSettings',
745-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
788+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
746789
},
747790
{
748791
type: 'assessments',
749-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
792+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
750793
},
751794
{
752795
type: 'deviceSecurityGroups',
753-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
796+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
754797
},
755798
{
756799
type: 'iotSensors',
757-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
800+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
758801
},
759802
{
760803
type: 'informationProtectionPolicies',
@@ -766,7 +809,7 @@ const autoGenList: AutoGenConfig[] = [
766809
},
767810
{
768811
type: 'iotSites',
769-
scopes: ScopeType.Subcription | ScopeType.ResourceGroup | ScopeType.Extension,
812+
scopes: ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension,
770813
},
771814
]
772815
},
@@ -948,7 +991,7 @@ const autoGenList: AutoGenConfig[] = [
948991
resourceConfig: [
949992
{
950993
type: 'diagnosticSettings',
951-
scopes: ScopeType.Subcription | ScopeType.Extension,
994+
scopes: ScopeType.Subscription | ScopeType.Extension,
952995
},
953996
{
954997
type: 'guestDiagnosticSettingsAssociation',
@@ -1006,7 +1049,12 @@ const autoGenList: AutoGenConfig[] = [
10061049
namespace: 'Microsoft.Network',
10071050
postProcessor: networkPostProcessor,
10081051
suffix: 'NRP'
1009-
}
1052+
},
1053+
{
1054+
basePath: 'dnsresolver/resource-manager',
1055+
namespace: 'Microsoft.Network',
1056+
suffix: 'DnsResolver',
1057+
},
10101058
];
10111059

10121060
export function findAutogenEntries(basePath: string): AutoGenConfig[] {

generator/cmd/generatesingle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ executeSynchronous(async () => {
3030
try {
3131
readme = validateAndReturnReadmePath(localPath, basePath);
3232
} catch {
33-
throw new Error(`Unable to find a readme under '${basePath}'. Please try running 'npm run list-basepaths' to find the list of valid paths.`);
33+
throw new Error(`Unable to find a readme under '${localPath}' for base path '${basePath}'. Please try running 'npm run list-basepaths' to find the list of valid paths.`);
3434
}
3535

3636
const schemaConfigs = [];

generator/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const managementGroupRootSchema = {
3535
export const generatedSchemasTemplatePath = path.join(__dirname, 'resources/autogeneratedResources_template.json');
3636

3737
export const autorestCoreVersion = '3.0.6374';
38-
export const azureresourceschemaVersion = '3.0.92';
38+
export const azureresourceschemaVersion = '3.0.109';
3939

4040
// paths in this list won't even appear in list-basepaths.
4141
// This list should only contain spec paths that should DEFINITELY be excluded from generation.

generator/generate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface RootSchemaConfiguration {
3030

3131
const RootSchemaConfigs: Map<ScopeType, RootSchemaConfiguration> = new Map([
3232
[ScopeType.Tenant, constants.tenantRootSchema],
33-
[ScopeType.Subcription, constants.subscriptionRootSchema],
33+
[ScopeType.Subscription, constants.subscriptionRootSchema],
3434
[ScopeType.ResourceGroup, constants.resourceGroupRootSchema],
3535
[ScopeType.ManagementGroup, constants.managementGroupRootSchema]
3636
]);
@@ -190,7 +190,7 @@ async function generateSchemaConfig(outputFile: string, namespace: string, apiVe
190190
const knownReferences = [
191191
...getSchemaRefs(output, ScopeType.Tenant, 'tenant_resourceDefinitions'),
192192
...getSchemaRefs(output, ScopeType.ManagementGroup, 'managementGroup_resourceDefinitions'),
193-
...getSchemaRefs(output, ScopeType.Subcription, 'subscription_resourceDefinitions'),
193+
...getSchemaRefs(output, ScopeType.Subscription, 'subscription_resourceDefinitions'),
194194
...getSchemaRefs(output, ScopeType.ResourceGroup, 'resourceDefinitions'),
195195
...getSchemaRefs(output, ScopeType.Extension, 'extension_resourceDefinitions'),
196196
];
@@ -226,7 +226,7 @@ async function generateSchemaConfig(outputFile: string, namespace: string, apiVe
226226
}
227227
}
228228

229-
const subscriptionSchemaRefs = references.filter(x => x.scope & ScopeType.Subcription);
229+
const subscriptionSchemaRefs = references.filter(x => x.scope & ScopeType.Subscription);
230230
if (subscriptionSchemaRefs.length > 0) {
231231
console.log('Resource Types (Subscription Scope):');
232232
for (const schemaRef of subscriptionSchemaRefs) {

generator/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export enum ScopeType {
44
None = 0,
55
Unknown = 1 << 0,
66
Tenant = 1 << 1,
7-
Subcription = 1 << 2,
7+
Subscription = 1 << 2,
88
ResourceGroup = 1 << 3,
99
ManagementGroup = 1 << 4,
1010
Extension = 1 << 5,

generator/package-lock.json

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

generator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"lint:fix": "eslint . --ext ts --fix"
2222
},
2323
"devDependencies": {
24-
"@autorest/azureresourceschema": "^3.0.103",
24+
"@autorest/azureresourceschema": "^3.0.109",
2525
"@autorest/core": "^3.5.1",
2626
"@ts-common/commonmark-to-markdown": "^2.0.0",
2727
"@types/async": "^3.2.9",

generator/processors/Microsoft.Network.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { replaceCyclicRef } from './helpers';
55

66
export const postProcessor: SchemaPostProcessor = async (namespace, apiVersion, schema) => {
77
replaceCyclicRef(schema.definitions?.NetworkInterfaceIPConfigurationPropertiesFormat?.properties?.virtualNetworkTaps?.oneOf[0]?.items);
8-
replaceCyclicRef(schema.definitions?.NetworkInterfaceIPConfiguration?.properties?.properties?.oneOf[0]?.properties?.publicIPAddress?.oneOf[0]?.properties?.properties?.oneOf[0]?.properties?.ipConfiguration?.oneOf[0]?.properties?.properties?.oneOf[0]?.properties?.subnet?.oneOf[0]?.properties?.properties?.oneOf[0]?.properties?.networkSecurityGroup?.oneOf[0]?.properties?.properties?.oneOf[0]?.properties?.networkInterfaces?.oneOf[0].items);
98
replaceCyclicRef(schema.definitions?.NetworkInterfaceIPConfigurationPropertiesFormat?.properties?.ipConfiguration?.oneOf[0]?.items);
10-
replaceCyclicRef(schema.definitions?.NetworkInterfaceIPConfigurationPropertiesFormat?.properties?.applictionGatewayBackendAddressPools?.oneOf[0]?.items);
9+
replaceCyclicRef(schema.definitions?.NetworkInterfaceIPConfigurationPropertiesFormat?.properties?.applicationGatewayBackendAddressPools?.oneOf[0]?.items);
1110
replaceCyclicRef(schema.definitions?.ApplicationGatewayBackendAddressPoolPropertiesFormat?.properties?.backendIPConfigurations?.oneOf[0]?.items);
1211
replaceCyclicRef(schema.definitions?.RouteFilterPropertiesFormat?.properties?.peerings?.oneOf[0]?.items);
1312
replaceCyclicRef(schema.definitions?.Ipv6ExpressRouteCircuitPeeringConfig?.properties?.routeFilter?.oneOf[0]?.items);
1413
replaceCyclicRef(schema.definitions?.PublicIPAddressPropertiesFormat?.properties?.linkedPublicIPAddress?.oneOf[0]);
1514
replaceCyclicRef(schema.definitions?.PublicIPAddressPropertiesFormat?.properties?.servicePublicIPAddress?.oneOf[0]);
16-
replaceCyclicRef(schema.definitions?.CustomIpPrefix?.properties?.properties?.oneOf[0]?.properties?.customIpPrefixParent?.oneOf[0]);
1715
replaceCyclicRef(schema.definitions?.ContainerNetworkInterfaceConfigurationPropertiesFormat?.properties?.containerNetworkInterfaces?.oneOf[0]?.items);
16+
replaceCyclicRef(schema.definitions?.NetworkInterfacePropertiesFormat?.properties?.ipConfigurations?.oneOf[0]?.items);
17+
replaceCyclicRef(schema.definitions?.CustomIpPrefixPropertiesFormat?.properties?.customIpPrefixParent?.oneOf[0]);
1818
}

0 commit comments

Comments
 (0)