Skip to content

Commit

Permalink
Expose that settable properties are so. (googleapis#3472)
Browse files Browse the repository at this point in the history
* Expose that settable properties are so.

Closes googleapis#2610.
  • Loading branch information
tseaver authored and landrito committed Aug 22, 2017
1 parent 65931a8 commit d067fa9
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions storage/google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down

0 comments on commit d067fa9

Please sign in to comment.