-
Notifications
You must be signed in to change notification settings - Fork 170
feat: add support for 'Blob.custom_time' and lifecycle rules #199
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c03d6ae
feat(storage): add support of custom time metadata and timestamp
HemangChothani 7347cf2
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani ef32ca2
Merge branch 'master' into storage_issue_196
jkwlui 0212ca4
feat(storage): change the return type of custom_time_before
HemangChothani a6c830c
feat(storage): add setter method
HemangChothani 3dbda6a
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 04e3a10
Merge branch 'master' into storage_issue_196
tseaver 75e6067
feat(storage): add test for None value
HemangChothani 7ee2796
Merge branch 'storage_issue_196' of https://github.com/q-logic/python…
HemangChothani e2793ce
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 43f1f5a
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 0bd9bf4
feat(storage): changes in unittest
HemangChothani fee993f
feat(storage): change custom_time type to date
HemangChothani 76457b1
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani ae71f29
feat: change custom_time to datetime
HemangChothani d99fcb9
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 62781a3
Merge branch 'master' into storage_issue_196
frankyn 0fcf160
Merge branch 'master' into storage_issue_196
frankyn 39a12f0
feat: nit
HemangChothani 285e15b
Merge branch 'storage_issue_196' of https://github.com/q-logic/python…
HemangChothani 780a616
feat: resolve conflict and nit
HemangChothani e76b8bb
Merge branch 'master' into storage_issue_196
frankyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(storage): add setter method
- Loading branch information
commit a6c830c5e56c64fcc1b9697b424a0d25785b2dec
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ | |
| from google.api_core.iam import Policy | ||
| from google.cloud import exceptions | ||
| from google.cloud._helpers import _bytes_to_unicode | ||
| from google.cloud._helpers import _datetime_to_rfc3339 | ||
| from google.cloud._helpers import _rfc3339_to_datetime | ||
| from google.cloud._helpers import _to_bytes | ||
| from google.cloud.exceptions import NotFound | ||
|
|
@@ -3018,6 +3019,18 @@ def custom_time(self): | |
| if value is not None: | ||
| return _rfc3339_to_datetime(value) | ||
|
|
||
| @custom_time.setter | ||
| def custom_time(self, value): | ||
| """Set the custom time for the object. | ||
|
|
||
| See https://cloud.google.com/storage/docs/json_api/v1/objects | ||
|
|
||
| :type value: :class:`datetime.datetime` | ||
| :param value: (Optional) Set the custom time of blob. Datetime object parsed | ||
|
||
| from RFC3339 valid timestamp. | ||
| """ | ||
| self._properties["customTime"] = _datetime_to_rfc3339(value) | ||
tseaver marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| def _get_encryption_headers(key, source=False): | ||
| """Builds customer encryption key headers | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.