Skip to content

Commit

Permalink
[Internal] Change name with the aliases in codegen template (#3936)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->
Change name with the aliases in codegen template.
## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] relevant acceptance tests are passing
- [ ] using Go SDK
  • Loading branch information
parthban-db authored Aug 22, 2024
1 parent 8ed75c2 commit b9f5e90
Show file tree
Hide file tree
Showing 17 changed files with 2,478 additions and 738 deletions.
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7437dabb9dadee402c1fc060df4c1ce8cc5369f0
3eae49b444cac5a0118a3503e5b7ecef7f96527a
2 changes: 1 addition & 1 deletion .codegen/model.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type {{.PascalName}} struct {
{{end}}

{{- define "field-tag" -}}
{{if .IsJson}}tfsdk:"{{.Name}}" tf:"{{if not .Required}}optional{{end}}"{{else}}tfsdk:"-"{{end -}}
{{if .IsJson}}tfsdk:"{{if and (ne .Entity.Terraform nil) (ne .Entity.Terraform.Alias "") }}{{.Entity.Terraform.Alias}}{{else}}{{.Name}}{{end}}" tf:"{{if not .Required}}optional{{end}}"{{else}}tfsdk:"-"{{end -}}
{{- end -}}

{{- define "type" -}}
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
internal/service/apps_tf/model.go linguist-generated=true
internal/service/billing_tf/model.go linguist-generated=true
internal/service/catalog_tf/model.go linguist-generated=true
internal/service/compute_tf/model.go linguist-generated=true
Expand Down
257 changes: 257 additions & 0 deletions internal/service/apps_tf/model.go

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

Loading

0 comments on commit b9f5e90

Please sign in to comment.