@@ -225,6 +225,21 @@ Only for use with external storage. Possible values: ["BASIC_COLUMNS", "GCS_COLU
225
225
},
226
226
},
227
227
},
228
+ "identifying_fields" : {
229
+ Type : schema .TypeList ,
230
+ Optional : true ,
231
+ Description : `Specifies the BigQuery fields that will be returned with findings.
232
+ If not specified, no identifying fields will be returned for findings.` ,
233
+ Elem : & schema.Resource {
234
+ Schema : map [string ]* schema.Schema {
235
+ "name" : {
236
+ Type : schema .TypeString ,
237
+ Required : true ,
238
+ Description : `Name of a BigQuery field to be returned with the findings.` ,
239
+ },
240
+ },
241
+ },
242
+ },
228
243
"rows_limit" : {
229
244
Type : schema .TypeInt ,
230
245
Optional : true ,
@@ -1114,6 +1129,8 @@ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptions(v
1114
1129
flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsRowsLimitPercent (original ["rowsLimitPercent" ], d , config )
1115
1130
transformed ["sample_method" ] =
1116
1131
flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSampleMethod (original ["sampleMethod" ], d , config )
1132
+ transformed ["identifying_fields" ] =
1133
+ flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields (original ["identifyingFields" ], d , config )
1117
1134
return []interface {}{transformed }
1118
1135
}
1119
1136
func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsTableReference (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
@@ -1183,6 +1200,28 @@ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSa
1183
1200
return v
1184
1201
}
1185
1202
1203
+ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
1204
+ if v == nil {
1205
+ return v
1206
+ }
1207
+ l := v .([]interface {})
1208
+ transformed := make ([]interface {}, 0 , len (l ))
1209
+ for _ , raw := range l {
1210
+ original := raw .(map [string ]interface {})
1211
+ if len (original ) < 1 {
1212
+ // Do not include empty json objects coming back from the api
1213
+ continue
1214
+ }
1215
+ transformed = append (transformed , map [string ]interface {}{
1216
+ "name" : flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsName (original ["name" ], d , config ),
1217
+ })
1218
+ }
1219
+ return transformed
1220
+ }
1221
+ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsName (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
1222
+ return v
1223
+ }
1224
+
1186
1225
func flattenDataLossPreventionJobTriggerInspectJobActions (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
1187
1226
if v == nil {
1188
1227
return v
@@ -1758,6 +1797,13 @@ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptions(v
1758
1797
transformed ["sampleMethod" ] = transformedSampleMethod
1759
1798
}
1760
1799
1800
+ transformedIdentifyingFields , err := expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields (original ["identifying_fields" ], d , config )
1801
+ if err != nil {
1802
+ return nil , err
1803
+ } else if val := reflect .ValueOf (transformedIdentifyingFields ); val .IsValid () && ! isEmptyValue (val ) {
1804
+ transformed ["identifyingFields" ] = transformedIdentifyingFields
1805
+ }
1806
+
1761
1807
return transformed , nil
1762
1808
}
1763
1809
@@ -1818,6 +1864,32 @@ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSam
1818
1864
return v , nil
1819
1865
}
1820
1866
1867
+ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1868
+ l := v .([]interface {})
1869
+ req := make ([]interface {}, 0 , len (l ))
1870
+ for _ , raw := range l {
1871
+ if raw == nil {
1872
+ continue
1873
+ }
1874
+ original := raw .(map [string ]interface {})
1875
+ transformed := make (map [string ]interface {})
1876
+
1877
+ transformedName , err := expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsName (original ["name" ], d , config )
1878
+ if err != nil {
1879
+ return nil , err
1880
+ } else if val := reflect .ValueOf (transformedName ); val .IsValid () && ! isEmptyValue (val ) {
1881
+ transformed ["name" ] = transformedName
1882
+ }
1883
+
1884
+ req = append (req , transformed )
1885
+ }
1886
+ return req , nil
1887
+ }
1888
+
1889
+ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsName (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1890
+ return v , nil
1891
+ }
1892
+
1821
1893
func expandDataLossPreventionJobTriggerInspectJobActions (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1822
1894
l := v .([]interface {})
1823
1895
req := make ([]interface {}, 0 , len (l ))
0 commit comments