@@ -78,8 +78,8 @@ string with a length limit of 128 characters.`,
78
78
Type : schema .TypeString ,
79
79
Required : true ,
80
80
ForceNew : true ,
81
- ValidateFunc : verify .ValidateEnum ([]string {"GENERIC" , "MEDIA" }),
82
- Description : `The industry vertical that the data store registers. Possible values: ["GENERIC", "MEDIA"]` ,
81
+ ValidateFunc : verify .ValidateEnum ([]string {"GENERIC" , "MEDIA" , "HEALTHCARE_FHIR" }),
82
+ Description : `The industry vertical that the data store registers. Possible values: ["GENERIC", "MEDIA", "HEALTHCARE_FHIR" ]` ,
83
83
},
84
84
"location" : {
85
85
Type : schema .TypeString ,
@@ -104,6 +104,38 @@ PUBLIC_WEBSITE contentConfig), this flag will be ignored.`,
104
104
MaxItems : 1 ,
105
105
Elem : & schema.Resource {
106
106
Schema : map [string ]* schema.Schema {
107
+ "chunking_config" : {
108
+ Type : schema .TypeList ,
109
+ Optional : true ,
110
+ Description : `Whether chunking mode is enabled.` ,
111
+ MaxItems : 1 ,
112
+ Elem : & schema.Resource {
113
+ Schema : map [string ]* schema.Schema {
114
+ "layout_based_chunking_config" : {
115
+ Type : schema .TypeList ,
116
+ Optional : true ,
117
+ Description : `Configuration for the layout based chunking.` ,
118
+ MaxItems : 1 ,
119
+ Elem : & schema.Resource {
120
+ Schema : map [string ]* schema.Schema {
121
+ "chunk_size" : {
122
+ Type : schema .TypeInt ,
123
+ Optional : true ,
124
+ Description : `The token size limit for each chunk.
125
+ Supported values: 100-500 (inclusive). Default value: 500.` ,
126
+ },
127
+ "include_ancestor_headings" : {
128
+ Type : schema .TypeBool ,
129
+ Optional : true ,
130
+ Description : `Whether to include appending different levels of headings to chunks from the middle of the document to prevent context loss.
131
+ Default value: False.` ,
132
+ },
133
+ },
134
+ },
135
+ },
136
+ },
137
+ },
138
+ },
107
139
"default_parsing_config" : {
108
140
Type : schema .TypeList ,
109
141
Optional : true ,
@@ -123,6 +155,16 @@ config will be applied to all file types for Document parsing.`,
123
155
},
124
156
ExactlyOneOf : []string {},
125
157
},
158
+ "layout_parsing_config" : {
159
+ Type : schema .TypeList ,
160
+ Optional : true ,
161
+ Description : `Configurations applied to layout parser.` ,
162
+ MaxItems : 1 ,
163
+ Elem : & schema.Resource {
164
+ Schema : map [string ]* schema.Schema {},
165
+ },
166
+ ExactlyOneOf : []string {},
167
+ },
126
168
"ocr_parsing_config" : {
127
169
Type : schema .TypeList ,
128
170
Optional : true ,
@@ -165,6 +207,16 @@ config will be applied to all file types for Document parsing.`,
165
207
},
166
208
ExactlyOneOf : []string {},
167
209
},
210
+ "layout_parsing_config" : {
211
+ Type : schema .TypeList ,
212
+ Optional : true ,
213
+ Description : `Configurations applied to layout parser.` ,
214
+ MaxItems : 1 ,
215
+ Elem : & schema.Resource {
216
+ Schema : map [string ]* schema.Schema {},
217
+ },
218
+ ExactlyOneOf : []string {},
219
+ },
168
220
"ocr_parsing_config" : {
169
221
Type : schema .TypeList ,
170
222
Optional : true ,
@@ -209,10 +261,10 @@ specified.`,
209
261
Type : schema .TypeList ,
210
262
Optional : true ,
211
263
ForceNew : true ,
212
- Description : `The solutions that the data store enrolls. Possible values: ["SOLUTION_TYPE_RECOMMENDATION", "SOLUTION_TYPE_SEARCH", "SOLUTION_TYPE_CHAT"]` ,
264
+ Description : `The solutions that the data store enrolls. Possible values: ["SOLUTION_TYPE_RECOMMENDATION", "SOLUTION_TYPE_SEARCH", "SOLUTION_TYPE_CHAT", "SOLUTION_TYPE_GENERATIVE_CHAT" ]` ,
213
265
Elem : & schema.Schema {
214
266
Type : schema .TypeString ,
215
- ValidateFunc : verify .ValidateEnum ([]string {"SOLUTION_TYPE_RECOMMENDATION" , "SOLUTION_TYPE_SEARCH" , "SOLUTION_TYPE_CHAT" }),
267
+ ValidateFunc : verify .ValidateEnum ([]string {"SOLUTION_TYPE_RECOMMENDATION" , "SOLUTION_TYPE_SEARCH" , "SOLUTION_TYPE_CHAT" , "SOLUTION_TYPE_GENERATIVE_CHAT" }),
216
268
},
217
269
},
218
270
"create_time" : {
@@ -591,6 +643,8 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfig(v interface{}, d *s
591
643
transformed := make (map [string ]interface {})
592
644
transformed ["name" ] =
593
645
flattenDiscoveryEngineDataStoreDocumentProcessingConfigName (original ["name" ], d , config )
646
+ transformed ["chunking_config" ] =
647
+ flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfig (original ["chunkingConfig" ], d , config )
594
648
transformed ["default_parsing_config" ] =
595
649
flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig (original ["defaultParsingConfig" ], d , config )
596
650
transformed ["parsing_config_overrides" ] =
@@ -601,6 +655,52 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigName(v interface{},
601
655
return v
602
656
}
603
657
658
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
659
+ if v == nil {
660
+ return nil
661
+ }
662
+ original := v .(map [string ]interface {})
663
+ if len (original ) == 0 {
664
+ return nil
665
+ }
666
+ transformed := make (map [string ]interface {})
667
+ transformed ["layout_based_chunking_config" ] =
668
+ flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig (original ["layoutBasedChunkingConfig" ], d , config )
669
+ return []interface {}{transformed }
670
+ }
671
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
672
+ if v == nil {
673
+ return nil
674
+ }
675
+ original := v .(map [string ]interface {})
676
+ transformed := make (map [string ]interface {})
677
+ transformed ["chunk_size" ] =
678
+ flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigChunkSize (original ["chunkSize" ], d , config )
679
+ transformed ["include_ancestor_headings" ] =
680
+ flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigIncludeAncestorHeadings (original ["includeAncestorHeadings" ], d , config )
681
+ return []interface {}{transformed }
682
+ }
683
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigChunkSize (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
684
+ // Handles the string fixed64 format
685
+ if strVal , ok := v .(string ); ok {
686
+ if intVal , err := tpgresource .StringToFixed64 (strVal ); err == nil {
687
+ return intVal
688
+ }
689
+ }
690
+
691
+ // number values are represented as float64
692
+ if floatVal , ok := v .(float64 ); ok {
693
+ intVal := int (floatVal )
694
+ return intVal
695
+ }
696
+
697
+ return v // let terraform core handle it otherwise
698
+ }
699
+
700
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigIncludeAncestorHeadings (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
701
+ return v
702
+ }
703
+
604
704
func flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
605
705
if v == nil {
606
706
return nil
@@ -614,6 +714,8 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig
614
714
flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigDigitalParsingConfig (original ["digitalParsingConfig" ], d , config )
615
715
transformed ["ocr_parsing_config" ] =
616
716
flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigOcrParsingConfig (original ["ocrParsingConfig" ], d , config )
717
+ transformed ["layout_parsing_config" ] =
718
+ flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigLayoutParsingConfig (original ["layoutParsingConfig" ], d , config )
617
719
return []interface {}{transformed }
618
720
}
619
721
func flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigDigitalParsingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -641,6 +743,14 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig
641
743
return v
642
744
}
643
745
746
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigLayoutParsingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
747
+ if v == nil {
748
+ return nil
749
+ }
750
+ transformed := make (map [string ]interface {})
751
+ return []interface {}{transformed }
752
+ }
753
+
644
754
func flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverrides (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
645
755
if v == nil {
646
756
return v
@@ -653,6 +763,7 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverrid
653
763
"file_type" : k ,
654
764
"digital_parsing_config" : flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesDigitalParsingConfig (original ["digitalParsingConfig" ], d , config ),
655
765
"ocr_parsing_config" : flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesOcrParsingConfig (original ["ocrParsingConfig" ], d , config ),
766
+ "layout_parsing_config" : flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesLayoutParsingConfig (original ["layoutParsingConfig" ], d , config ),
656
767
})
657
768
}
658
769
return transformed
@@ -682,6 +793,14 @@ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverrid
682
793
return v
683
794
}
684
795
796
+ func flattenDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesLayoutParsingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
797
+ if v == nil {
798
+ return nil
799
+ }
800
+ transformed := make (map [string ]interface {})
801
+ return []interface {}{transformed }
802
+ }
803
+
685
804
func flattenDiscoveryEngineDataStoreCreateTime (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
686
805
return v
687
806
}
@@ -718,6 +837,13 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfig(v interface{}, d tpg
718
837
transformed ["name" ] = transformedName
719
838
}
720
839
840
+ transformedChunkingConfig , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfig (original ["chunking_config" ], d , config )
841
+ if err != nil {
842
+ return nil , err
843
+ } else if val := reflect .ValueOf (transformedChunkingConfig ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
844
+ transformed ["chunkingConfig" ] = transformedChunkingConfig
845
+ }
846
+
721
847
transformedDefaultParsingConfig , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig (original ["default_parsing_config" ], d , config )
722
848
if err != nil {
723
849
return nil , err
@@ -739,6 +865,64 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfigName(v interface{}, d
739
865
return v , nil
740
866
}
741
867
868
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
869
+ l := v .([]interface {})
870
+ if len (l ) == 0 || l [0 ] == nil {
871
+ return nil , nil
872
+ }
873
+ raw := l [0 ]
874
+ original := raw .(map [string ]interface {})
875
+ transformed := make (map [string ]interface {})
876
+
877
+ transformedLayoutBasedChunkingConfig , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig (original ["layout_based_chunking_config" ], d , config )
878
+ if err != nil {
879
+ return nil , err
880
+ } else {
881
+ transformed ["layoutBasedChunkingConfig" ] = transformedLayoutBasedChunkingConfig
882
+ }
883
+
884
+ return transformed , nil
885
+ }
886
+
887
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
888
+ l := v .([]interface {})
889
+ if len (l ) == 0 {
890
+ return nil , nil
891
+ }
892
+
893
+ if l [0 ] == nil {
894
+ transformed := make (map [string ]interface {})
895
+ return transformed , nil
896
+ }
897
+ raw := l [0 ]
898
+ original := raw .(map [string ]interface {})
899
+ transformed := make (map [string ]interface {})
900
+
901
+ transformedChunkSize , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigChunkSize (original ["chunk_size" ], d , config )
902
+ if err != nil {
903
+ return nil , err
904
+ } else if val := reflect .ValueOf (transformedChunkSize ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
905
+ transformed ["chunkSize" ] = transformedChunkSize
906
+ }
907
+
908
+ transformedIncludeAncestorHeadings , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigIncludeAncestorHeadings (original ["include_ancestor_headings" ], d , config )
909
+ if err != nil {
910
+ return nil , err
911
+ } else if val := reflect .ValueOf (transformedIncludeAncestorHeadings ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
912
+ transformed ["includeAncestorHeadings" ] = transformedIncludeAncestorHeadings
913
+ }
914
+
915
+ return transformed , nil
916
+ }
917
+
918
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigChunkSize (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
919
+ return v , nil
920
+ }
921
+
922
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfigIncludeAncestorHeadings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
923
+ return v , nil
924
+ }
925
+
742
926
func expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
743
927
l := v .([]interface {})
744
928
if len (l ) == 0 || l [0 ] == nil {
@@ -762,6 +946,13 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfig(
762
946
transformed ["ocrParsingConfig" ] = transformedOcrParsingConfig
763
947
}
764
948
949
+ transformedLayoutParsingConfig , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigLayoutParsingConfig (original ["layout_parsing_config" ], d , config )
950
+ if err != nil {
951
+ return nil , err
952
+ } else {
953
+ transformed ["layoutParsingConfig" ] = transformedLayoutParsingConfig
954
+ }
955
+
765
956
return transformed , nil
766
957
}
767
958
@@ -803,6 +994,21 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigO
803
994
return v , nil
804
995
}
805
996
997
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigDefaultParsingConfigLayoutParsingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
998
+ l := v .([]interface {})
999
+ if len (l ) == 0 {
1000
+ return nil , nil
1001
+ }
1002
+
1003
+ if l [0 ] == nil {
1004
+ transformed := make (map [string ]interface {})
1005
+ return transformed , nil
1006
+ }
1007
+ transformed := make (map [string ]interface {})
1008
+
1009
+ return transformed , nil
1010
+ }
1011
+
806
1012
func expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverrides (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]interface {}, error ) {
807
1013
if v == nil {
808
1014
return map [string ]interface {}{}, nil
@@ -826,6 +1032,13 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverride
826
1032
transformed ["ocrParsingConfig" ] = transformedOcrParsingConfig
827
1033
}
828
1034
1035
+ transformedLayoutParsingConfig , err := expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesLayoutParsingConfig (original ["layout_parsing_config" ], d , config )
1036
+ if err != nil {
1037
+ return nil , err
1038
+ } else {
1039
+ transformed ["layoutParsingConfig" ] = transformedLayoutParsingConfig
1040
+ }
1041
+
829
1042
transformedFileType , err := tpgresource .ExpandString (original ["file_type" ], d , config )
830
1043
if err != nil {
831
1044
return nil , err
@@ -872,3 +1085,18 @@ func expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverride
872
1085
func expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesOcrParsingConfigUseNativeText (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
873
1086
return v , nil
874
1087
}
1088
+
1089
+ func expandDiscoveryEngineDataStoreDocumentProcessingConfigParsingConfigOverridesLayoutParsingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1090
+ l := v .([]interface {})
1091
+ if len (l ) == 0 {
1092
+ return nil , nil
1093
+ }
1094
+
1095
+ if l [0 ] == nil {
1096
+ transformed := make (map [string ]interface {})
1097
+ return transformed , nil
1098
+ }
1099
+ transformed := make (map [string ]interface {})
1100
+
1101
+ return transformed , nil
1102
+ }
0 commit comments