@@ -2689,13 +2689,10 @@ def autoclass_enabled(self, value):
2689
2689
:type value: convertible to boolean
2690
2690
:param value: If true, enable Autoclass for this bucket.
2691
2691
If false, disable Autoclass for this bucket.
2692
-
2693
- .. note::
2694
- To enable autoclass, you must set it at bucket creation time.
2695
- Currently, only patch requests that disable autoclass are supported.
2696
-
2697
2692
"""
2698
- self ._patch_property ("autoclass" , {"enabled" : bool (value )})
2693
+ autoclass = self ._properties .get ("autoclass" , {})
2694
+ autoclass ["enabled" ] = bool (value )
2695
+ self ._patch_property ("autoclass" , autoclass )
2699
2696
2700
2697
@property
2701
2698
def autoclass_toggle_time (self ):
@@ -2709,6 +2706,48 @@ def autoclass_toggle_time(self):
2709
2706
if timestamp is not None :
2710
2707
return _rfc3339_nanos_to_datetime (timestamp )
2711
2708
2709
+ @property
2710
+ def autoclass_terminal_storage_class (self ):
2711
+ """The storage class that objects in an Autoclass bucket eventually transition to if
2712
+ they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE.
2713
+
2714
+ See https://cloud.google.com/storage/docs/using-autoclass for details.
2715
+
2716
+ :setter: Set the terminal storage class for Autoclass configuration.
2717
+ :getter: Get the terminal storage class for Autoclass configuration.
2718
+
2719
+ :rtype: str
2720
+ :returns: The terminal storage class if Autoclass is enabled, else ``None``.
2721
+ """
2722
+ autoclass = self ._properties .get ("autoclass" , {})
2723
+ return autoclass .get ("terminalStorageClass" , None )
2724
+
2725
+ @autoclass_terminal_storage_class .setter
2726
+ def autoclass_terminal_storage_class (self , value ):
2727
+ """The storage class that objects in an Autoclass bucket eventually transition to if
2728
+ they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE.
2729
+
2730
+ See https://cloud.google.com/storage/docs/using-autoclass for details.
2731
+
2732
+ :type value: str
2733
+ :param value: The only valid values are `"NEARLINE"` and `"ARCHIVE"`.
2734
+ """
2735
+ autoclass = self ._properties .get ("autoclass" , {})
2736
+ autoclass ["terminalStorageClass" ] = value
2737
+ self ._patch_property ("autoclass" , autoclass )
2738
+
2739
+ @property
2740
+ def autoclass_terminal_storage_class_update_time (self ):
2741
+ """The time at which the Autoclass terminal_storage_class field was last updated for this bucket
2742
+ :rtype: datetime.datetime or ``NoneType``
2743
+ :returns: point-in time at which the bucket's terminal_storage_class is last updated, or ``None`` if the property is not set locally.
2744
+ """
2745
+ autoclass = self ._properties .get ("autoclass" )
2746
+ if autoclass is not None :
2747
+ timestamp = autoclass .get ("terminalStorageClassUpdateTime" )
2748
+ if timestamp is not None :
2749
+ return _rfc3339_nanos_to_datetime (timestamp )
2750
+
2712
2751
def configure_website (self , main_page_suffix = None , not_found_page = None ):
2713
2752
"""Configure website-related properties.
2714
2753
0 commit comments