Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote hl7.parseConfig.version to GA #10099

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
3 changes: 3 additions & 0 deletions .changelog/5196.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
healthcare: promoted `google_healthcare_hl7_v2_store.parseConfig.version` to GA
```
27 changes: 26 additions & 1 deletion google/resource_healthcare_hl7_v2_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Fields/functions available for filtering are:
StateFunc: func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s },
Description: `JSON encoded string for schemas used to parse messages in this
store if schematized parsing is desired.`,
AtLeastOneOf: []string{"parser_config.0.allow_null_header", "parser_config.0.segment_terminator", "parser_config.0.schema"},
AtLeastOneOf: []string{"parser_config.0.allow_null_header", "parser_config.0.segment_terminator", "parser_config.0.schema", "parser_config.0.version"},
},
"segment_terminator": {
Type: schema.TypeString,
Expand All @@ -168,6 +168,14 @@ store if schematized parsing is desired.`,
A base64-encoded string.`,
AtLeastOneOf: []string{"parser_config.0.allow_null_header", "parser_config.0.segment_terminator", "parser_config.0.schema"},
},
"version": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"V1", "V2", ""}, false),
Description: `The version of the unschematized parser to be used when a custom 'schema' is not set. Default value: "V1" Possible values: ["V1", "V2"]`,
Default: "V1",
},
},
},
},
Expand Down Expand Up @@ -457,6 +465,8 @@ func flattenHealthcareHl7V2StoreParserConfig(v interface{}, d *schema.ResourceDa
flattenHealthcareHl7V2StoreParserConfigSegmentTerminator(original["segmentTerminator"], d, config)
transformed["schema"] =
flattenHealthcareHl7V2StoreParserConfigSchema(original["schema"], d, config)
transformed["version"] =
flattenHealthcareHl7V2StoreParserConfigVersion(original["version"], d, config)
return []interface{}{transformed}
}
func flattenHealthcareHl7V2StoreParserConfigAllowNullHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} {
Expand All @@ -479,6 +489,10 @@ func flattenHealthcareHl7V2StoreParserConfigSchema(v interface{}, d *schema.Reso
return string(b)
}

func flattenHealthcareHl7V2StoreParserConfigVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}

func flattenHealthcareHl7V2StoreLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}
Expand Down Expand Up @@ -561,6 +575,13 @@ func expandHealthcareHl7V2StoreParserConfig(v interface{}, d TerraformResourceDa
transformed["schema"] = transformedSchema
}

transformedVersion, err := expandHealthcareHl7V2StoreParserConfigVersion(original["version"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedVersion); val.IsValid() && !isEmptyValue(val) {
transformed["version"] = transformedVersion
}

return transformed, nil
}

Expand All @@ -584,6 +605,10 @@ func expandHealthcareHl7V2StoreParserConfigSchema(v interface{}, d TerraformReso
return m, nil
}

func expandHealthcareHl7V2StoreParserConfigVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandHealthcareHl7V2StoreLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) {
if v == nil {
return map[string]string{}, nil
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/healthcare_hl7_v2_store.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ The following arguments are supported:
store if schematized parsing is desired.

* `version` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
(Optional)
The version of the unschematized parser to be used when a custom `schema` is not set.
Default value is `V1`.
Possible values are `V1` and `V2`.
Expand Down