Skip to content

Commit bc5d7ac

Browse files
authored
Add automation@2024-10-23 API version (#5007)
* Add workaround for package resource * Add 2024-10-23 version
1 parent 297d157 commit bc5d7ac

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

config/resource-manager.hcl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ service "automanage" {
5252
}
5353
service "automation" {
5454
name = "Automation"
55-
available = ["2015-10-31", "2019-06-01", "2020-01-13-preview", "2022-08-08", "2023-11-01"]
56-
ignore = ["2024-10-23"]
55+
available = ["2015-10-31", "2019-06-01", "2020-01-13-preview", "2022-08-08", "2023-11-01", "2024-10-23"]
5756
}
5857
service "azure-kusto" {
5958
name = "Kusto"

tools/importer-rest-api-specs/internal/components/apidefinitions/parser/dataworkarounds/workaround_invalid_go_package_names.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type workaroundInvalidGoPackageNames struct{}
1616

1717
func (workaroundInvalidGoPackageNames) IsApplicable(_ string, apiVersion sdkModels.APIVersion) bool {
1818
for key := range apiVersion.Resources {
19-
if strings.EqualFold(key, "documentation") {
19+
if strings.EqualFold(key, "documentation") || strings.EqualFold(key, "package") {
2020
return true
2121
}
2222
}
@@ -43,6 +43,15 @@ func (workaroundInvalidGoPackageNames) Process(input sdkModels.APIVersion) (*sdk
4343
}
4444
}
4545

46+
// `package` is not a valid Go package name (reserved keyword), so let's rename it to `PackageResource`
47+
// double-checking that we're not overwriting anything
48+
if strings.EqualFold(resourceName, "package") {
49+
resourceName = "PackageResource"
50+
if _, ok := input.Resources[resourceName]; ok {
51+
return nil, fmt.Errorf("the Resource %q is not valid as a Go Package Name - however the replacement name %q is already in use", originalName, resourceName)
52+
}
53+
}
54+
4655
resources[resourceName] = resource
4756
}
4857
input.Resources = resources

0 commit comments

Comments
 (0)