Skip to content

Commit

Permalink
refactor(storage): consistent use of optional keyword (#81)
Browse files Browse the repository at this point in the history
Fixes #80
  • Loading branch information
HemangChothani authored Mar 14, 2020
1 parent c99b416 commit a50cdd1
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 181 deletions.
6 changes: 3 additions & 3 deletions google/cloud/storage/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def reload(self, client=None, timeout=_DEFAULT_TIMEOUT):
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current object.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -191,7 +191,7 @@ def patch(self, client=None, timeout=_DEFAULT_TIMEOUT):
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current object.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -227,7 +227,7 @@ def update(self, client=None, timeout=_DEFAULT_TIMEOUT):
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current object.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/storage/_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def generate_signed_url_v2(
:param expiration: Point in time when the signed URL should expire.
:type api_access_endpoint: str
:param api_access_endpoint: Optional URI base. Defaults to empty string.
:param api_access_endpoint: (Optional) URI base. Defaults to empty string.
:type method: str
:param method: The HTTP verb that will be used when requesting the URL.
Expand Down Expand Up @@ -466,7 +466,7 @@ def generate_signed_url_v4(
:param expiration: Point in time when the signed URL should expire.
:type api_access_endpoint: str
:param api_access_endpoint: Optional URI base. Defaults to
:param api_access_endpoint: (Optional) URI base. Defaults to
"https://storage.googleapis.com/"
:type method: str
Expand Down
29 changes: 14 additions & 15 deletions google/cloud/storage/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class _ACLEntity(object):
:param entity_type: The type of entity (ie, 'group' or 'user').
:type identifier: str
:param identifier: The ID or e-mail of the entity. For the special
entity types (like 'allUsers') this is optional.
:param identifier: (Optional) The ID or e-mail of the entity. For the special
entity types (like 'allUsers').
"""

READER_ROLE = "READER"
Expand Down Expand Up @@ -212,7 +212,7 @@ def _ensure_loaded(self, timeout=_DEFAULT_TIMEOUT):
"""Load if not already loaded.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -432,10 +432,10 @@ def reload(self, client=None, timeout=_DEFAULT_TIMEOUT):
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
:param client: (Optional) The client to use. If not passed, falls back
to the ``client`` stored on the ACL's parent.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -465,16 +465,15 @@ def _save(self, acl, predefined, client, timeout=_DEFAULT_TIMEOUT):
current entries.
:type predefined: str
:param predefined:
(Optional) An identifier for a predefined ACL. Must be one of the
:param predefined: An identifier for a predefined ACL. Must be one of the
keys in :attr:`PREDEFINED_JSON_ACLS` If passed, `acl` must be None.
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
:param client: (Optional) The client to use. If not passed, falls back
to the ``client`` stored on the ACL's parent.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -514,10 +513,10 @@ def save(self, acl=None, client=None, timeout=_DEFAULT_TIMEOUT):
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
:param client: (Optional) The client to use. If not passed, falls back
to the ``client`` stored on the ACL's parent.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down Expand Up @@ -546,10 +545,10 @@ def save_predefined(self, predefined, client=None, timeout=_DEFAULT_TIMEOUT):
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
:param client: (Optional) The client to use. If not passed, falls back
to the ``client`` stored on the ACL's parent.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand All @@ -570,10 +569,10 @@ def clear(self, client=None, timeout=_DEFAULT_TIMEOUT):
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
:param client: (Optional) The client to use. If not passed, falls back
to the ``client`` stored on the ACL's parent.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _do_request(
initialization of the object at a later time.
:type timeout: float or tuple
:param timeout: (optional) The amount of time, in seconds, to wait
:param timeout: (Optional) The amount of time, in seconds, to wait
for the server response.
Can also be passed as a tuple (connect_timeout, read_timeout).
Expand Down
Loading

0 comments on commit a50cdd1

Please sign in to comment.