Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose that settable properties are so. #3472

Merged
merged 2 commits into from
Jun 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions storage/google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,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.

This comment was marked as spam.


:rtype: list(dict)
:returns: A sequence of mappings describing each lifecycle rule.
"""
Expand All @@ -591,6 +594,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 CORS policy.

This comment was marked as spam.

This comment was marked as spam.

"""
self._patch_property('lifecycle', {'rule': rules})

location = _scalar_property('location')
Expand Down Expand Up @@ -691,10 +702,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 @@ -737,6 +751,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