Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions mmv1/api/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,17 +702,7 @@ func (t Type) FWResourceType() string {
// check :default_value, type: clazz
// }

// Checks that all conflicting properties actually exist.
// This currently just returns if empty, because we don't want to do the check, since
// this list will have a full path for nested attributes.
// func (t *Type) check_conflicts() {
// check :conflicts, type: ::Array, default: [], item_type: ::String

// return if @conflicts.empty?
// }

// Returns list of properties that are in conflict with this property.
// func (t *Type) conflicting() {
func (t Type) Conflicting() []string {
if t.ResourceMetadata == nil {
return []string{}
Expand All @@ -723,18 +713,7 @@ func (t Type) Conflicting() []string {
return t.Conflicts
}

// TODO rewrite: validation
// Checks that all properties that needs at least one of their fields actually exist.
// This currently just returns if empty, because we don't want to do the check, since
// this list will have a full path for nested attributes.
// func (t *Type) check_at_least_one_of() {
// check :at_least_one_of, type: ::Array, default: [], item_type: ::String

// return if @at_least_one_of.empty?
// }

// Returns list of properties that needs at least one of their fields set.
// func (t *Type) at_least_one_of_list() {
func (t Type) AtLeastOneOfList() []string {
if t.ResourceMetadata == nil {
return []string{}
Expand All @@ -745,18 +724,7 @@ func (t Type) AtLeastOneOfList() []string {
return t.AtLeastOneOf
}

// TODO rewrite: validation
// Checks that all properties that needs exactly one of their fields actually exist.
// This currently just returns if empty, because we don't want to do the check, since
// this list will have a full path for nested attributes.
// func (t *Type) check_exactly_one_of() {
// check :exactly_one_of, type: ::Array, default: [], item_type: ::String

// return if @exactly_one_of.empty?
// }

// Returns list of properties that needs exactly one of their fields set.
// func (t *Type) exactly_one_of_list() {
func (t Type) ExactlyOneOfList() []string {
if t.ResourceMetadata == nil {
return []string{}
Expand All @@ -767,16 +735,6 @@ func (t Type) ExactlyOneOfList() []string {
return t.ExactlyOneOf
}

// TODO rewrite: validation
// Checks that all properties that needs required with their fields actually exist.
// This currently just returns if empty, because we don't want to do the check, since
// this list will have a full path for nested attributes.
// func (t *Type) check_required_with() {
// check :required_with, type: ::Array, default: [], item_type: ::String

// return if @required_with.empty?
// }

// Returns list of properties that needs required with their fields set.
func (t Type) RequiredWithList() []string {
if t.ResourceMetadata == nil {
Expand Down
8 changes: 4 additions & 4 deletions mmv1/templates/terraform/schema_property.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@ Default value: {{ .ItemType.DefaultValue -}}
{{ if not (eq .DefaultValue nil ) -}}
Default: {{ .GoLiteral .DefaultValue -}},
{{ end -}}
{{ if or .Conflicting .Conflicts -}}
{{ if .Conflicting -}}
ConflictsWith: {{ .GoLiteral (.GetPropertySchemaPathList .Conflicting) -}},
{{ end -}}
{{ if or .AtLeastOneOfList .AtLeastOneOf -}}
{{ if .AtLeastOneOfList -}}
AtLeastOneOf: {{ .GoLiteral (.GetPropertySchemaPathList .AtLeastOneOfList) -}},
{{ end -}}
{{ if or .ExactlyOneOfList .ExactlyOneOf -}}
{{ if .ExactlyOneOfList -}}
ExactlyOneOf: {{ .GoLiteral (.GetPropertySchemaPathList .ExactlyOneOfList) -}},
{{ end -}}
{{ if or .RequiredWithList .RequiredWith -}}
{{ if .RequiredWithList -}}
RequiredWith: {{ .GoLiteral (.GetPropertySchemaPathList .RequiredWithList) -}},
{{ end -}}
},
Expand Down
Loading