From b24b315995d9b6cabe3bda4282d4372abef73533 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Jun 2017 13:33:09 -0400 Subject: [PATCH] Expose that settable properties are so. (#3472) * Expose that settable properties are so. Closes #2610. --- storage/google/cloud/storage/bucket.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/storage/google/cloud/storage/bucket.py b/storage/google/cloud/storage/bucket.py index 07f44be640fc..865a23840af4 100644 --- a/storage/google/cloud/storage/bucket.py +++ b/storage/google/cloud/storage/bucket.py @@ -608,11 +608,14 @@ def id(self): @property def lifecycle_rules(self): - """Lifecycle rules configured for this bucket. + """Retrieve or set lifecycle rules configured for this bucket. See https://cloud.google.com/storage/docs/lifecycle and https://cloud.google.com/storage/docs/json_api/v1/buckets + :setter: Set lifestyle rules for this bucket. + :getter: Gets the lifestyle rules for this bucket. + :rtype: list(dict) :returns: A sequence of mappings describing each lifecycle rule. """ @@ -621,6 +624,14 @@ def lifecycle_rules(self): @lifecycle_rules.setter def lifecycle_rules(self, rules): + """Set lifestyle rules configured for this bucket. + + See https://cloud.google.com/storage/docs/lifecycle and + https://cloud.google.com/storage/docs/json_api/v1/buckets + + :type entries: list of dictionaries + :param entries: A sequence of mappings describing each lifecycle rule. + """ self._patch_property('lifecycle', {'rule': rules}) location = _scalar_property('location') @@ -721,10 +732,13 @@ def self_link(self): @property def storage_class(self): - """Retrieve the storage class for the bucket. + """Retrieve or set the storage class for the bucket. See https://cloud.google.com/storage/docs/storage-classes + :setter: Set the storage class for this bucket. + :getter: Gets the the storage class for this bucket. + :rtype: str or ``NoneType`` :returns: If set, one of "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD", or @@ -767,6 +781,9 @@ def versioning_enabled(self): See https://cloud.google.com/storage/docs/object-versioning for details. + :setter: Update whether versioning is enabled for this bucket. + :getter: Query whether versioning is enabled for this bucket. + :rtype: bool :returns: True if enabled, else False. """