Skip to content

Commit a50cdd1

Browse files
refactor(storage): consistent use of optional keyword (#81)
Fixes #80
1 parent c99b416 commit a50cdd1

File tree

9 files changed

+183
-181
lines changed

9 files changed

+183
-181
lines changed

google/cloud/storage/_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def reload(self, client=None, timeout=_DEFAULT_TIMEOUT):
130130
:param client: the client to use. If not passed, falls back to the
131131
``client`` stored on the current object.
132132
:type timeout: float or tuple
133-
:param timeout: (optional) The amount of time, in seconds, to wait
133+
:param timeout: (Optional) The amount of time, in seconds, to wait
134134
for the server response.
135135
136136
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -191,7 +191,7 @@ def patch(self, client=None, timeout=_DEFAULT_TIMEOUT):
191191
:param client: the client to use. If not passed, falls back to the
192192
``client`` stored on the current object.
193193
:type timeout: float or tuple
194-
:param timeout: (optional) The amount of time, in seconds, to wait
194+
:param timeout: (Optional) The amount of time, in seconds, to wait
195195
for the server response.
196196
197197
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -227,7 +227,7 @@ def update(self, client=None, timeout=_DEFAULT_TIMEOUT):
227227
:param client: the client to use. If not passed, falls back to the
228228
``client`` stored on the current object.
229229
:type timeout: float or tuple
230-
:param timeout: (optional) The amount of time, in seconds, to wait
230+
:param timeout: (Optional) The amount of time, in seconds, to wait
231231
for the server response.
232232
233233
Can also be passed as a tuple (connect_timeout, read_timeout).

google/cloud/storage/_signing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def generate_signed_url_v2(
304304
:param expiration: Point in time when the signed URL should expire.
305305
306306
:type api_access_endpoint: str
307-
:param api_access_endpoint: Optional URI base. Defaults to empty string.
307+
:param api_access_endpoint: (Optional) URI base. Defaults to empty string.
308308
309309
:type method: str
310310
:param method: The HTTP verb that will be used when requesting the URL.
@@ -466,7 +466,7 @@ def generate_signed_url_v4(
466466
:param expiration: Point in time when the signed URL should expire.
467467
468468
:type api_access_endpoint: str
469-
:param api_access_endpoint: Optional URI base. Defaults to
469+
:param api_access_endpoint: (Optional) URI base. Defaults to
470470
"https://storage.googleapis.com/"
471471
472472
:type method: str

google/cloud/storage/acl.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class _ACLEntity(object):
9292
:param entity_type: The type of entity (ie, 'group' or 'user').
9393
9494
:type identifier: str
95-
:param identifier: The ID or e-mail of the entity. For the special
96-
entity types (like 'allUsers') this is optional.
95+
:param identifier: (Optional) The ID or e-mail of the entity. For the special
96+
entity types (like 'allUsers').
9797
"""
9898

9999
READER_ROLE = "READER"
@@ -212,7 +212,7 @@ def _ensure_loaded(self, timeout=_DEFAULT_TIMEOUT):
212212
"""Load if not already loaded.
213213
214214
:type timeout: float or tuple
215-
:param timeout: (optional) The amount of time, in seconds, to wait
215+
:param timeout: (Optional) The amount of time, in seconds, to wait
216216
for the server response.
217217
218218
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -432,10 +432,10 @@ def reload(self, client=None, timeout=_DEFAULT_TIMEOUT):
432432
433433
:type client: :class:`~google.cloud.storage.client.Client` or
434434
``NoneType``
435-
:param client: Optional. The client to use. If not passed, falls back
435+
:param client: (Optional) The client to use. If not passed, falls back
436436
to the ``client`` stored on the ACL's parent.
437437
:type timeout: float or tuple
438-
:param timeout: (optional) The amount of time, in seconds, to wait
438+
:param timeout: (Optional) The amount of time, in seconds, to wait
439439
for the server response.
440440
441441
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -465,16 +465,15 @@ def _save(self, acl, predefined, client, timeout=_DEFAULT_TIMEOUT):
465465
current entries.
466466
467467
:type predefined: str
468-
:param predefined:
469-
(Optional) An identifier for a predefined ACL. Must be one of the
468+
:param predefined: An identifier for a predefined ACL. Must be one of the
470469
keys in :attr:`PREDEFINED_JSON_ACLS` If passed, `acl` must be None.
471470
472471
:type client: :class:`~google.cloud.storage.client.Client` or
473472
``NoneType``
474-
:param client: Optional. The client to use. If not passed, falls back
473+
:param client: (Optional) The client to use. If not passed, falls back
475474
to the ``client`` stored on the ACL's parent.
476475
:type timeout: float or tuple
477-
:param timeout: (optional) The amount of time, in seconds, to wait
476+
:param timeout: (Optional) The amount of time, in seconds, to wait
478477
for the server response.
479478
480479
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -514,10 +513,10 @@ def save(self, acl=None, client=None, timeout=_DEFAULT_TIMEOUT):
514513
515514
:type client: :class:`~google.cloud.storage.client.Client` or
516515
``NoneType``
517-
:param client: Optional. The client to use. If not passed, falls back
516+
:param client: (Optional) The client to use. If not passed, falls back
518517
to the ``client`` stored on the ACL's parent.
519518
:type timeout: float or tuple
520-
:param timeout: (optional) The amount of time, in seconds, to wait
519+
:param timeout: (Optional) The amount of time, in seconds, to wait
521520
for the server response.
522521
523522
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -546,10 +545,10 @@ def save_predefined(self, predefined, client=None, timeout=_DEFAULT_TIMEOUT):
546545
547546
:type client: :class:`~google.cloud.storage.client.Client` or
548547
``NoneType``
549-
:param client: Optional. The client to use. If not passed, falls back
548+
:param client: (Optional) The client to use. If not passed, falls back
550549
to the ``client`` stored on the ACL's parent.
551550
:type timeout: float or tuple
552-
:param timeout: (optional) The amount of time, in seconds, to wait
551+
:param timeout: (Optional) The amount of time, in seconds, to wait
553552
for the server response.
554553
555554
Can also be passed as a tuple (connect_timeout, read_timeout).
@@ -570,10 +569,10 @@ def clear(self, client=None, timeout=_DEFAULT_TIMEOUT):
570569
571570
:type client: :class:`~google.cloud.storage.client.Client` or
572571
``NoneType``
573-
:param client: Optional. The client to use. If not passed, falls back
572+
:param client: (Optional) The client to use. If not passed, falls back
574573
to the ``client`` stored on the ACL's parent.
575574
:type timeout: float or tuple
576-
:param timeout: (optional) The amount of time, in seconds, to wait
575+
:param timeout: (Optional) The amount of time, in seconds, to wait
577576
for the server response.
578577
579578
Can also be passed as a tuple (connect_timeout, read_timeout).

google/cloud/storage/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _do_request(
177177
initialization of the object at a later time.
178178
179179
:type timeout: float or tuple
180-
:param timeout: (optional) The amount of time, in seconds, to wait
180+
:param timeout: (Optional) The amount of time, in seconds, to wait
181181
for the server response.
182182
183183
Can also be passed as a tuple (connect_timeout, read_timeout).

0 commit comments

Comments
 (0)