Skip to content

Commit

Permalink
Fix name based queries for device admin and network access data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jan 22, 2024
1 parent 954b4ee commit 5a9b0b4
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.1.11 (unreleased)

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

## 0.1.10

Expand Down
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: |-
## 0.1.11 (unreleased)

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

## 0.1.10

Expand Down
29 changes: 18 additions & 11 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,26 @@ func IsErs(endpoint string) bool {
return false
}

// Templating helper function to remove first path element
func RemoveFirstPathElement(path string) string {
elements := strings.Split(path, ".")
return strings.Join(elements[1:], ".")
}

// Map of templating functions
var functions = template.FuncMap{
"toGoName": ToGoName,
"camelCase": CamelCase,
"snakeCase": SnakeCase,
"sprintf": fmt.Sprintf,
"toLower": strings.ToLower,
"path": BuildPath,
"hasId": HasId,
"hasReference": HasReference,
"importParts": ImportParts,
"subtract": Subtract,
"isErs": IsErs,
"toGoName": ToGoName,
"camelCase": CamelCase,
"snakeCase": SnakeCase,
"sprintf": fmt.Sprintf,
"toLower": strings.ToLower,
"path": BuildPath,
"hasId": HasId,
"hasReference": HasReference,
"importParts": ImportParts,
"subtract": Subtract,
"isErs": IsErs,
"removeFirstPathElement": RemoveFirstPathElement,
}

func augmentAttribute(attr *YamlConfigAttribute) {
Expand Down
4 changes: 2 additions & 2 deletions gen/templates/data_source.go

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.

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.

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.

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.

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

1 change: 1 addition & 0 deletions templates/guides/changelog.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: |-
## 0.1.11 (unreleased)

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

## 0.1.10

Expand Down

0 comments on commit 5a9b0b4

Please sign in to comment.