Skip to content

Commit 3674c5a

Browse files
tseaverlandrito
authored andcommitted
Expose that settable properties are so. (googleapis#3472)
* Expose that settable properties are so. Closes googleapis#2610.
1 parent d6825e2 commit 3674c5a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

storage/google/cloud/storage/bucket.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,14 @@ def id(self):
608608

609609
@property
610610
def lifecycle_rules(self):
611-
"""Lifecycle rules configured for this bucket.
611+
"""Retrieve or set lifecycle rules configured for this bucket.
612612
613613
See https://cloud.google.com/storage/docs/lifecycle and
614614
https://cloud.google.com/storage/docs/json_api/v1/buckets
615615
616+
:setter: Set lifestyle rules for this bucket.
617+
:getter: Gets the lifestyle rules for this bucket.
618+
616619
:rtype: list(dict)
617620
:returns: A sequence of mappings describing each lifecycle rule.
618621
"""
@@ -621,6 +624,14 @@ def lifecycle_rules(self):
621624

622625
@lifecycle_rules.setter
623626
def lifecycle_rules(self, rules):
627+
"""Set lifestyle rules configured for this bucket.
628+
629+
See https://cloud.google.com/storage/docs/lifecycle and
630+
https://cloud.google.com/storage/docs/json_api/v1/buckets
631+
632+
:type entries: list of dictionaries
633+
:param entries: A sequence of mappings describing each lifecycle rule.
634+
"""
624635
self._patch_property('lifecycle', {'rule': rules})
625636

626637
location = _scalar_property('location')
@@ -721,10 +732,13 @@ def self_link(self):
721732

722733
@property
723734
def storage_class(self):
724-
"""Retrieve the storage class for the bucket.
735+
"""Retrieve or set the storage class for the bucket.
725736
726737
See https://cloud.google.com/storage/docs/storage-classes
727738
739+
:setter: Set the storage class for this bucket.
740+
:getter: Gets the the storage class for this bucket.
741+
728742
:rtype: str or ``NoneType``
729743
:returns: If set, one of "MULTI_REGIONAL", "REGIONAL",
730744
"NEARLINE", "COLDLINE", "STANDARD", or
@@ -767,6 +781,9 @@ def versioning_enabled(self):
767781
See https://cloud.google.com/storage/docs/object-versioning for
768782
details.
769783
784+
:setter: Update whether versioning is enabled for this bucket.
785+
:getter: Query whether versioning is enabled for this bucket.
786+
770787
:rtype: bool
771788
:returns: True if enabled, else False.
772789
"""

0 commit comments

Comments
 (0)