Skip to content

Commit

Permalink
Add templating support for sets
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 25, 2023
1 parent 57855dc commit 2903e19
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion gen/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test_prerequisites: str(required=False)
attribute:
model_name: str()
tf_name: str(required=False)
type: enum('String', 'Int64', 'Bool', 'List', 'Version', 'Versions', required=False)
type: enum('String', 'Int64', 'Bool', 'List', 'Set', 'Version', 'Versions', required=False)
object_type: enum('object', 'tree', 'list', required=False)
model_type_string: bool(required=False)
bool_empty_string: bool(required=False)
Expand Down
14 changes: 7 additions & 7 deletions gen/templates/generic/data_source.go

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

12 changes: 6 additions & 6 deletions gen/templates/generic/data_source_test.go

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

42 changes: 21 additions & 21 deletions gen/templates/generic/model.go

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

14 changes: 7 additions & 7 deletions gen/templates/generic/resource.go

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

6 changes: 3 additions & 3 deletions gen/templates/generic/resource.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
resource "sdwan_{{snakeCase .Name}}" "example" {
{{- range .Attributes}}
{{- if and (not .ExcludeTest) (not .ExcludeExample) (not .TfOnly) (not .Value)}}
{{- if eq .Type "List"}}
{{- if or (eq .Type "List") (eq .Type "Set")}}
{{.TfName}} = [
{
{{- range .Attributes}}
{{- if and (not .ExcludeTest) (not .ExcludeExample) (not .TfOnly) (not .Value)}}
{{- if eq .Type "List"}}
{{- if or (eq .Type "List") (eq .Type "Set")}}
{{.TfName}} = [
{
{{- range .Attributes}}
{{- if and (not .ExcludeTest) (not .ExcludeExample) (not .TfOnly) (not .Value)}}
{{- if eq .Type "List"}}
{{- if or (eq .Type "List") (eq .Type "Set")}}
{{.TfName}} = [
{
{{- range .Attributes}}
Expand Down
Loading

0 comments on commit 2903e19

Please sign in to comment.