@@ -225,6 +225,21 @@ Only for use with external storage. Possible values: ["BASIC_COLUMNS", "GCS_COLU
225225 },
226226 },
227227 },
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+ },
228243 "rows_limit" : {
229244 Type : schema .TypeInt ,
230245 Optional : true ,
@@ -1114,6 +1129,8 @@ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptions(v
11141129 flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsRowsLimitPercent (original ["rowsLimitPercent" ], d , config )
11151130 transformed ["sample_method" ] =
11161131 flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSampleMethod (original ["sampleMethod" ], d , config )
1132+ transformed ["identifying_fields" ] =
1133+ flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields (original ["identifyingFields" ], d , config )
11171134 return []interface {}{transformed }
11181135}
11191136func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsTableReference (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
@@ -1183,6 +1200,28 @@ func flattenDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSa
11831200 return v
11841201}
11851202
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+
11861225func flattenDataLossPreventionJobTriggerInspectJobActions (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
11871226 if v == nil {
11881227 return v
@@ -1758,6 +1797,13 @@ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptions(v
17581797 transformed ["sampleMethod" ] = transformedSampleMethod
17591798 }
17601799
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+
17611807 return transformed , nil
17621808}
17631809
@@ -1818,6 +1864,32 @@ func expandDataLossPreventionJobTriggerInspectJobStorageConfigBigQueryOptionsSam
18181864 return v , nil
18191865}
18201866
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+
18211893func expandDataLossPreventionJobTriggerInspectJobActions (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
18221894 l := v .([]interface {})
18231895 req := make ([]interface {}, 0 , len (l ))
0 commit comments