@@ -216,6 +216,16 @@ Changing this forces a new resource to be created.`,
216
216
Optional : true ,
217
217
Description : `Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days).` ,
218
218
},
219
+ "storage_billing_model" : {
220
+ Type : schema .TypeString ,
221
+ Computed : true ,
222
+ Optional : true ,
223
+ Description : `Specifies the storage billing model for the dataset.
224
+ Set this flag value to LOGICAL to use logical bytes for storage billing,
225
+ or to PHYSICAL to use physical bytes instead.
226
+
227
+ LOGICAL is the default if this flag isn't specified.` ,
228
+ },
219
229
"creation_time" : {
220
230
Type : schema .TypeInt ,
221
231
Computed : true ,
@@ -487,6 +497,12 @@ func resourceBigQueryDatasetCreate(d *schema.ResourceData, meta interface{}) err
487
497
} else if v , ok := d .GetOkExists ("default_collation" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (defaultCollationProp )) && (ok || ! reflect .DeepEqual (v , defaultCollationProp )) {
488
498
obj ["defaultCollation" ] = defaultCollationProp
489
499
}
500
+ storageBillingModelProp , err := expandBigQueryDatasetStorageBillingModel (d .Get ("storage_billing_model" ), d , config )
501
+ if err != nil {
502
+ return err
503
+ } else if v , ok := d .GetOkExists ("storage_billing_model" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (storageBillingModelProp )) && (ok || ! reflect .DeepEqual (v , storageBillingModelProp )) {
504
+ obj ["storageBillingModel" ] = storageBillingModelProp
505
+ }
490
506
491
507
url , err := tpgresource .ReplaceVars (d , config , "{{BigQueryBasePath}}projects/{{project}}/datasets" )
492
508
if err != nil {
@@ -635,6 +651,9 @@ func resourceBigQueryDatasetRead(d *schema.ResourceData, meta interface{}) error
635
651
if err := d .Set ("default_collation" , flattenBigQueryDatasetDefaultCollation (res ["defaultCollation" ], d , config )); err != nil {
636
652
return fmt .Errorf ("Error reading Dataset: %s" , err )
637
653
}
654
+ if err := d .Set ("storage_billing_model" , flattenBigQueryDatasetStorageBillingModel (res ["storageBillingModel" ], d , config )); err != nil {
655
+ return fmt .Errorf ("Error reading Dataset: %s" , err )
656
+ }
638
657
if err := d .Set ("self_link" , tpgresource .ConvertSelfLinkToV1 (res ["selfLink" ].(string ))); err != nil {
639
658
return fmt .Errorf ("Error reading Dataset: %s" , err )
640
659
}
@@ -730,6 +749,12 @@ func resourceBigQueryDatasetUpdate(d *schema.ResourceData, meta interface{}) err
730
749
} else if v , ok := d .GetOkExists ("default_collation" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , defaultCollationProp )) {
731
750
obj ["defaultCollation" ] = defaultCollationProp
732
751
}
752
+ storageBillingModelProp , err := expandBigQueryDatasetStorageBillingModel (d .Get ("storage_billing_model" ), d , config )
753
+ if err != nil {
754
+ return err
755
+ } else if v , ok := d .GetOkExists ("storage_billing_model" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , storageBillingModelProp )) {
756
+ obj ["storageBillingModel" ] = storageBillingModelProp
757
+ }
733
758
734
759
url , err := tpgresource .ReplaceVars (d , config , "{{BigQueryBasePath}}projects/{{project}}/datasets/{{dataset_id}}" )
735
760
if err != nil {
@@ -1117,6 +1142,10 @@ func flattenBigQueryDatasetDefaultCollation(v interface{}, d *schema.ResourceDat
1117
1142
return v
1118
1143
}
1119
1144
1145
+ func flattenBigQueryDatasetStorageBillingModel (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1146
+ return v
1147
+ }
1148
+
1120
1149
func expandBigQueryDatasetMaxTimeTravelHours (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1121
1150
return v , nil
1122
1151
}
@@ -1444,3 +1473,7 @@ func expandBigQueryDatasetIsCaseInsensitive(v interface{}, d tpgresource.Terrafo
1444
1473
func expandBigQueryDatasetDefaultCollation (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1445
1474
return v , nil
1446
1475
}
1476
+
1477
+ func expandBigQueryDatasetStorageBillingModel (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1478
+ return v , nil
1479
+ }
0 commit comments