@@ -120,6 +120,12 @@ will fail with an error.
120120** Changing this property may recreate the FHIR store (removing all data) **
121121
122122** This property can be changed manually in the Google Cloud Healthcare admin console without recreating the FHIR store **` ,
123+ },
124+ "enable_history_modifications" : {
125+ Type : schema .TypeBool ,
126+ Optional : true ,
127+ Description : `Whether to allow the ExecuteBundle API to accept history bundles, and directly insert and overwrite historical
128+ resource versions into the FHIR store. If set to false, using history bundles fails with an error.` ,
123129 },
124130 "enable_update_create" : {
125131 Type : schema .TypeBool ,
@@ -383,6 +389,12 @@ func resourceHealthcareFhirStoreCreate(d *schema.ResourceData, meta interface{})
383389 } else if v , ok := d .GetOkExists ("enable_history_import" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (enableHistoryImportProp )) && (ok || ! reflect .DeepEqual (v , enableHistoryImportProp )) {
384390 obj ["enableHistoryImport" ] = enableHistoryImportProp
385391 }
392+ enableHistoryModificationsProp , err := expandHealthcareFhirStoreEnableHistoryModifications (d .Get ("enable_history_modifications" ), d , config )
393+ if err != nil {
394+ return err
395+ } else if v , ok := d .GetOkExists ("enable_history_modifications" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (enableHistoryModificationsProp )) && (ok || ! reflect .DeepEqual (v , enableHistoryModificationsProp )) {
396+ obj ["enableHistoryModifications" ] = enableHistoryModificationsProp
397+ }
386398 notificationConfigProp , err := expandHealthcareFhirStoreNotificationConfig (d .Get ("notification_config" ), d , config )
387399 if err != nil {
388400 return err
@@ -515,6 +527,9 @@ func resourceHealthcareFhirStoreRead(d *schema.ResourceData, meta interface{}) e
515527 if err := d .Set ("enable_history_import" , flattenHealthcareFhirStoreEnableHistoryImport (res ["enableHistoryImport" ], d , config )); err != nil {
516528 return fmt .Errorf ("Error reading FhirStore: %s" , err )
517529 }
530+ if err := d .Set ("enable_history_modifications" , flattenHealthcareFhirStoreEnableHistoryModifications (res ["enableHistoryModifications" ], d , config )); err != nil {
531+ return fmt .Errorf ("Error reading FhirStore: %s" , err )
532+ }
518533 if err := d .Set ("labels" , flattenHealthcareFhirStoreLabels (res ["labels" ], d , config )); err != nil {
519534 return fmt .Errorf ("Error reading FhirStore: %s" , err )
520535 }
@@ -562,6 +577,12 @@ func resourceHealthcareFhirStoreUpdate(d *schema.ResourceData, meta interface{})
562577 } else if v , ok := d .GetOkExists ("enable_update_create" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , enableUpdateCreateProp )) {
563578 obj ["enableUpdateCreate" ] = enableUpdateCreateProp
564579 }
580+ enableHistoryModificationsProp , err := expandHealthcareFhirStoreEnableHistoryModifications (d .Get ("enable_history_modifications" ), d , config )
581+ if err != nil {
582+ return err
583+ } else if v , ok := d .GetOkExists ("enable_history_modifications" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , enableHistoryModificationsProp )) {
584+ obj ["enableHistoryModifications" ] = enableHistoryModificationsProp
585+ }
565586 notificationConfigProp , err := expandHealthcareFhirStoreNotificationConfig (d .Get ("notification_config" ), d , config )
566587 if err != nil {
567588 return err
@@ -609,6 +630,10 @@ func resourceHealthcareFhirStoreUpdate(d *schema.ResourceData, meta interface{})
609630 updateMask = append (updateMask , "enableUpdateCreate" )
610631 }
611632
633+ if d .HasChange ("enable_history_modifications" ) {
634+ updateMask = append (updateMask , "enableHistoryModifications" )
635+ }
636+
612637 if d .HasChange ("notification_config" ) {
613638 updateMask = append (updateMask , "notificationConfig" )
614639 }
@@ -749,6 +774,10 @@ func flattenHealthcareFhirStoreEnableHistoryImport(v interface{}, d *schema.Reso
749774 return v
750775}
751776
777+ func flattenHealthcareFhirStoreEnableHistoryModifications (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
778+ return v
779+ }
780+
752781func flattenHealthcareFhirStoreLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
753782 if v == nil {
754783 return v
@@ -967,6 +996,10 @@ func expandHealthcareFhirStoreEnableHistoryImport(v interface{}, d tpgresource.T
967996 return v , nil
968997}
969998
999+ func expandHealthcareFhirStoreEnableHistoryModifications (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1000+ return v , nil
1001+ }
1002+
9701003func expandHealthcareFhirStoreNotificationConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
9711004 l := v .([]interface {})
9721005 if len (l ) == 0 || l [0 ] == nil {
0 commit comments