Skip to content

Commit 4bde545

Browse files
tswastcojenco
authored andcommitted
Remove None from param types and add (Optional).
This runs a script to remove None from the types for parameters, and added (Optional) to the description. Does not pass lint due to some too-long lines. I will clean those up manually. See: googleapis/google-cloud-python#2580 (review)
1 parent 8164e10 commit 4bde545

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

google/cloud/storage/acl.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ def _save(self, acl, predefined, client):
419419
:param acl: The ACL object to save. If left blank, this will save
420420
current entries.
421421
422-
:type predefined: str or None
423-
:param predefined: An identifier for a predefined ACL. Must be one
422+
:type predefined: str
423+
:param predefined: (Optional) An identifier for a predefined ACL. Must be one
424424
of the keys in :attr:`PREDEFINED_JSON_ACLS`
425425
If passed, `acl` must be None.
426426

google/cloud/storage/batch.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class MIMEApplicationHTTP(MIMEApplication):
4444
:type headers: dict
4545
:param headers: HTTP headers
4646
47-
:type body: str or None
48-
:param body: HTTP payload
47+
:type body: str
48+
:param body: (Optional) HTTP payload
4949
5050
"""
5151
def __init__(self, method, uri, headers, body):
@@ -154,8 +154,8 @@ def _do_request(self, method, url, headers, data, target_object):
154154
:type data: str
155155
:param data: The data to send as the body of the request.
156156
157-
:type target_object: object or :class:`NoneType`
158-
:param target_object: This allows us to enable custom behavior in our
157+
:type target_object: object
158+
:param target_object: (Optional) This allows us to enable custom behavior in our
159159
batch connection. Here we defer an HTTP request
160160
and complete initialization of the object at a
161161
later time.

google/cloud/storage/blob.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def chunk_size(self):
9494
def chunk_size(self, value):
9595
"""Set the blob's default chunk size.
9696
97-
:type value: int or ``NoneType``
98-
:param value: The current blob's chunk size, if it is set.
97+
:type value: int
98+
:param value: (Optional) The current blob's chunk size, if it is set.
9999
100100
:raises: :class:`ValueError` if ``value`` is not ``None`` and is not a
101101
multiple of 256 KB.
@@ -450,7 +450,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
450450
:func:`os.fstat`. (If the file handle is not from the
451451
filesystem this won't be possible.)
452452
453-
:type content_type: str or ``NoneType``
453+
:type content_type: str
454454
:param content_type: Optional type of content being uploaded.
455455
456456
:type num_retries: int
@@ -567,7 +567,7 @@ def upload_from_filename(self, filename, content_type=None, client=None):
567567
:type filename: str
568568
:param filename: The path to the file.
569569
570-
:type content_type: str or ``NoneType``
570+
:type content_type: str
571571
:param content_type: Optional type of content being uploaded.
572572
573573
:type client: :class:`~google.cloud.storage.client.Client` or
@@ -861,8 +861,8 @@ def metadata(self, value):
861861
862862
See: https://cloud.google.com/storage/docs/json_api/v1/objects
863863
864-
:type value: dict or ``NoneType``
865-
:param value: The blob metadata to set.
864+
:type value: dict
865+
:param value: (Optional) The blob metadata to set.
866866
"""
867867
self._patch_property('metadata', value)
868868

google/cloud/storage/client.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -227,24 +227,24 @@ def list_buckets(self, max_results=None, page_token=None, prefix=None,
227227
228228
This implements "storage.buckets.list".
229229
230-
:type max_results: int or ``NoneType``
230+
:type max_results: int
231231
:param max_results: Optional. Maximum number of buckets to return.
232232
233-
:type page_token: str or ``NoneType``
233+
:type page_token: str
234234
:param page_token: Optional. Opaque marker for the next "page" of
235235
buckets. If not passed, will return the first page
236236
of buckets.
237237
238-
:type prefix: str or ``NoneType``
238+
:type prefix: str
239239
:param prefix: Optional. Filter results to buckets whose names begin
240240
with this prefix.
241241
242-
:type projection: str or ``NoneType``
243-
:param projection: If used, must be 'full' or 'noAcl'. Defaults to
242+
:type projection: str
243+
:param projection: (Optional) If used, must be 'full' or 'noAcl'. Defaults to
244244
'noAcl'. Specifies the set of properties to return.
245245
246-
:type fields: str or ``NoneType``
247-
:param fields: Selector specifying which fields to include in a
246+
:type fields: str
247+
:param fields: (Optional) Selector specifying which fields to include in a
248248
partial response. Must be a list of fields. For example
249249
to get a partial response with just the next page token
250250
and the language of each bucket returned:

0 commit comments

Comments
 (0)