Skip to content

Commit 5a9b0b4

Browse files
committed
Fix name based queries for device admin and network access data sources
1 parent 954b4ee commit 5a9b0b4

13 files changed

+39
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.1.11 (unreleased)
22

33
- Fix import operation of nested resources (e.g. `ise_network_access_authentication_rule`)
4+
- Fix name-based queries for `device_admin` and `network_access` data sources
45

56
## 0.1.10
67

docs/guides/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description: |-
1010
## 0.1.11 (unreleased)
1111

1212
- Fix import operation of nested resources (e.g. `ise_network_access_authentication_rule`)
13+
- Fix name-based queries for `device_admin` and `network_access` data sources
1314

1415
## 0.1.10
1516

gen/generator.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,26 @@ func IsErs(endpoint string) bool {
247247
return false
248248
}
249249

250+
// Templating helper function to remove first path element
251+
func RemoveFirstPathElement(path string) string {
252+
elements := strings.Split(path, ".")
253+
return strings.Join(elements[1:], ".")
254+
}
255+
250256
// Map of templating functions
251257
var functions = template.FuncMap{
252-
"toGoName": ToGoName,
253-
"camelCase": CamelCase,
254-
"snakeCase": SnakeCase,
255-
"sprintf": fmt.Sprintf,
256-
"toLower": strings.ToLower,
257-
"path": BuildPath,
258-
"hasId": HasId,
259-
"hasReference": HasReference,
260-
"importParts": ImportParts,
261-
"subtract": Subtract,
262-
"isErs": IsErs,
258+
"toGoName": ToGoName,
259+
"camelCase": CamelCase,
260+
"snakeCase": SnakeCase,
261+
"sprintf": fmt.Sprintf,
262+
"toLower": strings.ToLower,
263+
"path": BuildPath,
264+
"hasId": HasId,
265+
"hasReference": HasReference,
266+
"importParts": ImportParts,
267+
"subtract": Subtract,
268+
"isErs": IsErs,
269+
"removeFirstPathElement": RemoveFirstPathElement,
263270
}
264271

265272
func augmentAttribute(attr *YamlConfigAttribute) {

gen/templates/data_source.go

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

internal/provider/data_source_ise_device_admin_authentication_rule.go

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

internal/provider/data_source_ise_device_admin_authorization_exception_rule.go

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

internal/provider/data_source_ise_device_admin_authorization_global_exception_rule.go

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

internal/provider/data_source_ise_device_admin_authorization_rule.go

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

internal/provider/data_source_ise_network_access_authentication_rule.go

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

internal/provider/data_source_ise_network_access_authorization_exception_rule.go

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

0 commit comments

Comments
 (0)