15
15
# pylint: disable=too-many-lines
16
16
17
17
"""Create / interact with Google Cloud Storage blobs.
18
-
19
- .. _API reference docs: https://cloud.google.com/storage/docs/\
20
- json_api/v1/objects
21
- .. _customer-supplied: https://cloud.google.com/storage/docs/\
22
- encryption#customer-supplied
23
- .. _google-resumable-media: https://googleapis.github.io/\
24
- google-resumable-media-python/latest/\
25
- google.resumable_media.requests.html
26
18
"""
27
19
28
20
import base64
@@ -1048,7 +1040,8 @@ def download_to_file(
1048
1040
If the server-set property, :attr:`media_link`, is not yet
1049
1041
initialized, makes an additional API request to load it.
1050
1042
1051
- Downloading a file that has been encrypted with a `customer-supplied`_
1043
+ Downloading a file that has been encrypted with a
1044
+ [`customer-supplied`](https://cloud.google.com/storage/docs/encryption#customer-supplied)
1052
1045
encryption key:
1053
1046
1054
1047
.. literalinclude:: snippets.py
@@ -1064,8 +1057,8 @@ def download_to_file(
1064
1057
of data in each request.
1065
1058
1066
1059
For more fine-grained control over the download process, check out
1067
- `google-resumable-media`_. For example, this library allows
1068
- downloading **parts** of a blob rather than the whole thing.
1060
+ [ `google-resumable-media`](https://googleapis.dev/python/google-resumable-media/latest/index.html).
1061
+ For example, this library allows downloading **parts** of a blob rather than the whole thing.
1069
1062
1070
1063
If :attr:`user_project` is set on the bucket, bills the API request
1071
1064
to that project.
@@ -1694,8 +1687,8 @@ def _get_writable_metadata(self):
1694
1687
1695
1688
This is intended to be used when creating a new object / blob.
1696
1689
1697
- See the `API reference docs`_ for more information, the fields
1698
- marked as writable are:
1690
+ See the [ `API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects)
1691
+ for more information, the fields marked as writable are:
1699
1692
1700
1693
* ``acl``
1701
1694
* ``cacheControl``
@@ -2445,7 +2438,8 @@ def upload_from_file(
2445
2438
See the `object versioning`_ and `lifecycle`_ API documents
2446
2439
for details.
2447
2440
2448
- Uploading a file with a `customer-supplied`_ encryption key:
2441
+ Uploading a file with a
2442
+ [`customer-supplied`](https://cloud.google.com/storage/docs/encryption#customer-supplied) encryption key:
2449
2443
2450
2444
.. literalinclude:: snippets.py
2451
2445
:start-after: [START upload_from_file]
@@ -2460,7 +2454,7 @@ def upload_from_file(
2460
2454
uploaded in a single multipart upload request.
2461
2455
2462
2456
For more fine-grained over the upload process, check out
2463
- `google-resumable-media`_ .
2457
+ [ `google-resumable-media`](https://googleapis.dev/python/google-resumable-media/latest/index.html) .
2464
2458
2465
2459
If :attr:`user_project` is set on the bucket, bills the API request
2466
2460
to that project.
@@ -2911,7 +2905,8 @@ def create_resumable_upload_session(
2911
2905
API documents for details.
2912
2906
2913
2907
If :attr:`encryption_key` is set, the blob will be encrypted with
2914
- a `customer-supplied`_ encryption key.
2908
+ a [`customer-supplied`](https://cloud.google.com/storage/docs/encryption#customer-supplied)
2909
+ encryption key.
2915
2910
2916
2911
If :attr:`user_project` is set on the bucket, bills the API request
2917
2912
to that project.
@@ -3931,51 +3926,47 @@ def open(
3931
3926
cache_control = _scalar_property ("cacheControl" )
3932
3927
"""HTTP 'Cache-Control' header for this object.
3933
3928
3934
- See `RFC 7234`_ and `API reference docs`_.
3929
+ See [`RFC 7234`](https://tools.ietf.org/html/rfc7234#section-5.2)
3930
+ and [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3935
3931
3936
3932
:rtype: str or ``NoneType``
3937
3933
3938
- .. _RFC 7234: https://tools.ietf.org/html/rfc7234#section-5.2
3939
3934
"""
3940
3935
3941
3936
content_disposition = _scalar_property ("contentDisposition" )
3942
3937
"""HTTP 'Content-Disposition' header for this object.
3943
3938
3944
- See `RFC 6266`_ and `API reference docs`_.
3939
+ See [`RFC 6266`](https://tools.ietf.org/html/rfc7234#section-5.2) and
3940
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3945
3941
3946
3942
:rtype: str or ``NoneType``
3947
-
3948
- .. _RFC 6266: https://tools.ietf.org/html/rfc7234#section-5.2
3949
3943
"""
3950
3944
3951
3945
content_encoding = _scalar_property ("contentEncoding" )
3952
3946
"""HTTP 'Content-Encoding' header for this object.
3953
3947
3954
- See `RFC 7231`_ and `API reference docs`_.
3948
+ See [`RFC 7231`](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) and
3949
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3955
3950
3956
3951
:rtype: str or ``NoneType``
3957
-
3958
- .. _RFC 7231: https://tools.ietf.org/html/rfc7231#section-3.1.2.2
3959
3952
"""
3960
3953
3961
3954
content_language = _scalar_property ("contentLanguage" )
3962
3955
"""HTTP 'Content-Language' header for this object.
3963
3956
3964
- See `BCP47`_ and `API reference docs`_.
3957
+ See [`BCP47`](https://tools.ietf.org/html/bcp47) and
3958
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3965
3959
3966
3960
:rtype: str or ``NoneType``
3967
-
3968
- .. _BCP47: https://tools.ietf.org/html/bcp47
3969
3961
"""
3970
3962
3971
3963
content_type = _scalar_property (_CONTENT_TYPE_FIELD )
3972
3964
"""HTTP 'Content-Type' header for this object.
3973
3965
3974
- See `RFC 2616`_ and `API reference docs`_.
3966
+ See [`RFC 2616`](https://tools.ietf.org/html/rfc2616#section-14.17) and
3967
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3975
3968
3976
3969
:rtype: str or ``NoneType``
3977
-
3978
- .. _RFC 2616: https://tools.ietf.org/html/rfc2616#section-14.17
3979
3970
"""
3980
3971
3981
3972
crc32c = _scalar_property ("crc32c" )
@@ -3984,13 +3975,13 @@ def open(
3984
3975
This returns the blob's CRC32C checksum. To retrieve the value, first use a
3985
3976
reload method of the Blob class which loads the blob's properties from the server.
3986
3977
3987
- See `RFC 4960`_ and `API reference docs`_.
3978
+ See [`RFC 4960`](https://tools.ietf.org/html/rfc4960#appendix-B) and
3979
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
3988
3980
3989
3981
If not set before upload, the server will compute the hash.
3990
3982
3991
3983
:rtype: str or ``NoneType``
3992
3984
3993
- .. _RFC 4960: https://tools.ietf.org/html/rfc4960#appendix-B
3994
3985
3995
3986
Example:
3996
3987
Retrieve the crc32c hash of blob.
@@ -4029,20 +4020,19 @@ def component_count(self):
4029
4020
def etag (self ):
4030
4021
"""Retrieve the ETag for the object.
4031
4022
4032
- See `RFC 2616 (etags)`_ and `API reference docs`_.
4023
+ See [`RFC 2616 (etags)`](https://tools.ietf.org/html/rfc2616#section-3.11) and
4024
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
4033
4025
4034
4026
:rtype: str or ``NoneType``
4035
4027
:returns: The blob etag or ``None`` if the blob's resource has not
4036
4028
been loaded from the server.
4037
-
4038
- .. _RFC 2616 (etags): https://tools.ietf.org/html/rfc2616#section-3.11
4039
4029
"""
4040
4030
return self ._properties .get ("etag" )
4041
4031
4042
4032
event_based_hold = _scalar_property ("eventBasedHold" )
4043
4033
"""Is an event-based hold active on the object?
4044
4034
4045
- See `API reference docs`_ .
4035
+ See [ `API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects) .
4046
4036
4047
4037
If the property is not set locally, returns :data:`None`.
4048
4038
@@ -4083,14 +4073,13 @@ def id(self):
4083
4073
This returns the blob's MD5 hash. To retrieve the value, first use a
4084
4074
reload method of the Blob class which loads the blob's properties from the server.
4085
4075
4086
- See `RFC 1321`_ and `API reference docs`_.
4076
+ See [`RFC 1321`](https://tools.ietf.org/html/rfc1321) and
4077
+ [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
4087
4078
4088
4079
If not set before upload, the server will compute the hash.
4089
4080
4090
4081
:rtype: str or ``NoneType``
4091
4082
4092
- .. _RFC 1321: https://tools.ietf.org/html/rfc1321
4093
-
4094
4083
Example:
4095
4084
Retrieve the md5 hash of blob.
4096
4085
@@ -4265,7 +4254,7 @@ def kms_key_name(self, value):
4265
4254
temporary_hold = _scalar_property ("temporaryHold" )
4266
4255
"""Is a temporary hold active on the object?
4267
4256
4268
- See `API reference docs`_ .
4257
+ See [ `API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects) .
4269
4258
4270
4259
If the property is not set locally, returns :data:`None`.
4271
4260
0 commit comments