@@ -501,7 +501,9 @@ def from_api_repr(cls, resource: dict) -> "AccessEntry":
501
501
if len (entry ) != 0 :
502
502
raise ValueError ("Entry has unexpected keys remaining." , entry )
503
503
504
- return cls (role , entity_type , entity_id )
504
+ config = cls (role , entity_type , entity_id )
505
+ config ._properties = copy .deepcopy (resource )
506
+ return config
505
507
506
508
507
509
class Dataset (object ):
@@ -525,6 +527,7 @@ class Dataset(object):
525
527
"friendly_name" : "friendlyName" ,
526
528
"default_encryption_configuration" : "defaultEncryptionConfiguration" ,
527
529
"storage_billing_model" : "storageBillingModel" ,
530
+ "max_time_travel_hours" : "maxTimeTravelHours" ,
528
531
"default_rounding_mode" : "defaultRoundingMode" ,
529
532
}
530
533
@@ -533,6 +536,27 @@ def __init__(self, dataset_ref) -> None:
533
536
dataset_ref = DatasetReference .from_string (dataset_ref )
534
537
self ._properties = {"datasetReference" : dataset_ref .to_api_repr (), "labels" : {}}
535
538
539
+ @property
540
+ def max_time_travel_hours (self ):
541
+ """
542
+ Optional[int]: Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days).
543
+ value must in multiple of 24 hours (48, 72, 96, 120, 144, 168)
544
+ The default value is 168 hours if this is not set.
545
+ """
546
+ return self ._properties .get ("maxTimeTravelHours" )
547
+
548
+ @max_time_travel_hours .setter
549
+ def max_time_travel_hours (self , hours ):
550
+ if not isinstance (hours , int ):
551
+ raise ValueError ("Pass the int value" )
552
+ if hours < 2 * 24 or hours > 7 * 24 :
553
+ raise ValueError (
554
+ "Time Travel Window should be from 48 to 168 hours (2 to 7 days)"
555
+ )
556
+ if hours % 24 != 0 :
557
+ raise ValueError ("Time Travel Window should be multiple of 24" )
558
+ self ._properties ["maxTimeTravelHours" ] = hours
559
+
536
560
@property
537
561
def default_rounding_mode (self ):
538
562
"""Union[str, None]: defaultRoundingMode of the dataset as set by the user
0 commit comments