Skip to content

Commit 9b29314

Browse files
authored
docs: fix links in blob module (#759)
Link formatting was causing the Blob module to not render correctly on c.g.c https://cloud.google.com/python/docs/reference/storage/latest/google.cloud.storage.blob Fix links according to python style guide and make the links more readable.
1 parent bd56931 commit 9b29314

File tree

1 file changed

+29
-40
lines changed

1 file changed

+29
-40
lines changed

google/cloud/storage/blob.py

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
# pylint: disable=too-many-lines
1616

1717
"""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
2618
"""
2719

2820
import base64
@@ -1048,7 +1040,8 @@ def download_to_file(
10481040
If the server-set property, :attr:`media_link`, is not yet
10491041
initialized, makes an additional API request to load it.
10501042
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)
10521045
encryption key:
10531046
10541047
.. literalinclude:: snippets.py
@@ -1064,8 +1057,8 @@ def download_to_file(
10641057
of data in each request.
10651058
10661059
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.
10691062
10701063
If :attr:`user_project` is set on the bucket, bills the API request
10711064
to that project.
@@ -1694,8 +1687,8 @@ def _get_writable_metadata(self):
16941687
16951688
This is intended to be used when creating a new object / blob.
16961689
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:
16991692
17001693
* ``acl``
17011694
* ``cacheControl``
@@ -2445,7 +2438,8 @@ def upload_from_file(
24452438
See the `object versioning`_ and `lifecycle`_ API documents
24462439
for details.
24472440
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:
24492443
24502444
.. literalinclude:: snippets.py
24512445
:start-after: [START upload_from_file]
@@ -2460,7 +2454,7 @@ def upload_from_file(
24602454
uploaded in a single multipart upload request.
24612455
24622456
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).
24642458
24652459
If :attr:`user_project` is set on the bucket, bills the API request
24662460
to that project.
@@ -2911,7 +2905,8 @@ def create_resumable_upload_session(
29112905
API documents for details.
29122906
29132907
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.
29152910
29162911
If :attr:`user_project` is set on the bucket, bills the API request
29172912
to that project.
@@ -3931,51 +3926,47 @@ def open(
39313926
cache_control = _scalar_property("cacheControl")
39323927
"""HTTP 'Cache-Control' header for this object.
39333928
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).
39353931
39363932
:rtype: str or ``NoneType``
39373933
3938-
.. _RFC 7234: https://tools.ietf.org/html/rfc7234#section-5.2
39393934
"""
39403935

39413936
content_disposition = _scalar_property("contentDisposition")
39423937
"""HTTP 'Content-Disposition' header for this object.
39433938
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).
39453941
39463942
:rtype: str or ``NoneType``
3947-
3948-
.. _RFC 6266: https://tools.ietf.org/html/rfc7234#section-5.2
39493943
"""
39503944

39513945
content_encoding = _scalar_property("contentEncoding")
39523946
"""HTTP 'Content-Encoding' header for this object.
39533947
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).
39553950
39563951
:rtype: str or ``NoneType``
3957-
3958-
.. _RFC 7231: https://tools.ietf.org/html/rfc7231#section-3.1.2.2
39593952
"""
39603953

39613954
content_language = _scalar_property("contentLanguage")
39623955
"""HTTP 'Content-Language' header for this object.
39633956
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).
39653959
39663960
:rtype: str or ``NoneType``
3967-
3968-
.. _BCP47: https://tools.ietf.org/html/bcp47
39693961
"""
39703962

39713963
content_type = _scalar_property(_CONTENT_TYPE_FIELD)
39723964
"""HTTP 'Content-Type' header for this object.
39733965
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).
39753968
39763969
:rtype: str or ``NoneType``
3977-
3978-
.. _RFC 2616: https://tools.ietf.org/html/rfc2616#section-14.17
39793970
"""
39803971

39813972
crc32c = _scalar_property("crc32c")
@@ -3984,13 +3975,13 @@ def open(
39843975
This returns the blob's CRC32C checksum. To retrieve the value, first use a
39853976
reload method of the Blob class which loads the blob's properties from the server.
39863977
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).
39883980
39893981
If not set before upload, the server will compute the hash.
39903982
39913983
:rtype: str or ``NoneType``
39923984
3993-
.. _RFC 4960: https://tools.ietf.org/html/rfc4960#appendix-B
39943985
39953986
Example:
39963987
Retrieve the crc32c hash of blob.
@@ -4029,20 +4020,19 @@ def component_count(self):
40294020
def etag(self):
40304021
"""Retrieve the ETag for the object.
40314022
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).
40334025
40344026
:rtype: str or ``NoneType``
40354027
:returns: The blob etag or ``None`` if the blob's resource has not
40364028
been loaded from the server.
4037-
4038-
.. _RFC 2616 (etags): https://tools.ietf.org/html/rfc2616#section-3.11
40394029
"""
40404030
return self._properties.get("etag")
40414031

40424032
event_based_hold = _scalar_property("eventBasedHold")
40434033
"""Is an event-based hold active on the object?
40444034
4045-
See `API reference docs`_.
4035+
See [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
40464036
40474037
If the property is not set locally, returns :data:`None`.
40484038
@@ -4083,14 +4073,13 @@ def id(self):
40834073
This returns the blob's MD5 hash. To retrieve the value, first use a
40844074
reload method of the Blob class which loads the blob's properties from the server.
40854075
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).
40874078
40884079
If not set before upload, the server will compute the hash.
40894080
40904081
:rtype: str or ``NoneType``
40914082
4092-
.. _RFC 1321: https://tools.ietf.org/html/rfc1321
4093-
40944083
Example:
40954084
Retrieve the md5 hash of blob.
40964085
@@ -4265,7 +4254,7 @@ def kms_key_name(self, value):
42654254
temporary_hold = _scalar_property("temporaryHold")
42664255
"""Is a temporary hold active on the object?
42674256
4268-
See `API reference docs`_.
4257+
See [`API reference docs`](https://cloud.google.com/storage/docs/json_api/v1/objects).
42694258
42704259
If the property is not set locally, returns :data:`None`.
42714260

0 commit comments

Comments
 (0)