@@ -35,6 +35,7 @@ import (
3535
3636 "github.com/hashicorp/terraform-provider-google-beta/google-beta/tpgresource"
3737 transport_tpg "github.com/hashicorp/terraform-provider-google-beta/google-beta/transport"
38+ "github.com/hashicorp/terraform-provider-google-beta/google-beta/verify"
3839)
3940
4041func ResourceDataplexAspectType () * schema.Resource {
@@ -66,6 +67,17 @@ func ResourceDataplexAspectType() *schema.Resource {
6667 ForceNew : true ,
6768 Description : `The aspect type id of the aspect type.` ,
6869 },
70+ "data_classification" : {
71+ Type : schema .TypeString ,
72+ Optional : true ,
73+ ForceNew : true ,
74+ ValidateFunc : verify .ValidateEnum ([]string {"DATA_CLASSIFICATION_UNSPECIFIED" , "METADATA_AND_DATA" , "" }),
75+ DiffSuppressFunc : tpgresource .EmptyOrDefaultStringSuppress ("DATA_CLASSIFICATION_UNSPECIFIED" ),
76+ Description : `Classifies the data stored by the aspect.
77+ 'DATA_CLASSIFICATION_UNSPECIFIED' denotes that the aspect contains only metadata
78+ while 'METADATA_AND_DATA' indicates data derived content.
79+ <br><br> Possible values: ["DATA_CLASSIFICATION_UNSPECIFIED", "METADATA_AND_DATA"]` ,
80+ },
6981 "description" : {
7082 Type : schema .TypeString ,
7183 Optional : true ,
@@ -175,6 +187,12 @@ func resourceDataplexAspectTypeCreate(d *schema.ResourceData, meta interface{})
175187 } else if v , ok := d .GetOkExists ("metadata_template" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (metadataTemplateProp )) && (ok || ! reflect .DeepEqual (v , metadataTemplateProp )) {
176188 obj ["metadataTemplate" ] = metadataTemplateProp
177189 }
190+ dataClassificationProp , err := expandDataplexAspectTypeDataClassification (d .Get ("data_classification" ), d , config )
191+ if err != nil {
192+ return err
193+ } else if v , ok := d .GetOkExists ("data_classification" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (dataClassificationProp )) && (ok || ! reflect .DeepEqual (v , dataClassificationProp )) {
194+ obj ["dataClassification" ] = dataClassificationProp
195+ }
178196 effectiveLabelsProp , err := expandDataplexAspectTypeEffectiveLabels (d .Get ("effective_labels" ), d , config )
179197 if err != nil {
180198 return err
@@ -307,6 +325,9 @@ func resourceDataplexAspectTypeRead(d *schema.ResourceData, meta interface{}) er
307325 if err := d .Set ("transfer_status" , flattenDataplexAspectTypeTransferStatus (res ["transferStatus" ], d , config )); err != nil {
308326 return fmt .Errorf ("Error reading AspectType: %s" , err )
309327 }
328+ if err := d .Set ("data_classification" , flattenDataplexAspectTypeDataClassification (res ["dataClassification" ], d , config )); err != nil {
329+ return fmt .Errorf ("Error reading AspectType: %s" , err )
330+ }
310331 if err := d .Set ("terraform_labels" , flattenDataplexAspectTypeTerraformLabels (res ["labels" ], d , config )); err != nil {
311332 return fmt .Errorf ("Error reading AspectType: %s" , err )
312333 }
@@ -556,6 +577,10 @@ func flattenDataplexAspectTypeTransferStatus(v interface{}, d *schema.ResourceDa
556577 return v
557578}
558579
580+ func flattenDataplexAspectTypeDataClassification (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
581+ return v
582+ }
583+
559584func flattenDataplexAspectTypeTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
560585 if v == nil {
561586 return v
@@ -595,6 +620,10 @@ func expandDataplexAspectTypeMetadataTemplate(v interface{}, d tpgresource.Terra
595620 return m , nil
596621}
597622
623+ func expandDataplexAspectTypeDataClassification (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
624+ return v , nil
625+ }
626+
598627func expandDataplexAspectTypeEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
599628 if v == nil {
600629 return map [string ]string {}, nil
0 commit comments