diff --git a/bigquery/google/cloud/bigquery/dataset.py b/bigquery/google/cloud/bigquery/dataset.py index af0740d1feb0..423484c68d51 100644 --- a/bigquery/google/cloud/bigquery/dataset.py +++ b/bigquery/google/cloud/bigquery/dataset.py @@ -216,8 +216,8 @@ def default_table_expiration_ms(self): def default_table_expiration_ms(self, value): """Update default expiration time for tables in the dataset. - :type value: int, or ``NoneType`` - :param value: new default time, in milliseconds + :type value: int + :param value: (Optional) new default time, in milliseconds :raises: ValueError for invalid value types. """ @@ -238,8 +238,8 @@ def description(self): def description(self, value): """Update description of the dataset. - :type value: str, or ``NoneType`` - :param value: new description + :type value: str + :param value: (Optional) new description :raises: ValueError for invalid value types. """ @@ -260,8 +260,8 @@ def friendly_name(self): def friendly_name(self, value): """Update title of the dataset. - :type value: str, or ``NoneType`` - :param value: new title + :type value: str + :param value: (Optional) new title :raises: ValueError for invalid value types. """ @@ -282,8 +282,8 @@ def location(self): def location(self, value): """Update location in which the dataset is hosted. - :type value: str, or ``NoneType`` - :param value: new location + :type value: str + :param value: (Optional) new location :raises: ValueError for invalid value types. """ diff --git a/bigquery/google/cloud/bigquery/query.py b/bigquery/google/cloud/bigquery/query.py index 97e89c7cb5d8..5c7c3681a539 100644 --- a/bigquery/google/cloud/bigquery/query.py +++ b/bigquery/google/cloud/bigquery/query.py @@ -345,18 +345,19 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None, See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults - :type max_results: int or ``NoneType`` - :param max_results: maximum number of rows to return. + :type max_results: int + :param max_results: (Optional) maximum number of rows to return. - :type page_token: str or ``NoneType`` - :param page_token: token representing a cursor into the table's rows. + :type page_token: str + :param page_token: + (Optional) token representing a cursor into the table's rows. - :type start_index: int or ``NoneType`` - :param start_index: zero-based index of starting row + :type start_index: int + :param start_index: (Optional) zero-based index of starting row - :type timeout_ms: int or ``NoneType`` - :param timeout_ms: timeout, in milliseconds, to wait for query to - complete + :type timeout_ms: int + :param timeout_ms: + (Optional) timeout, in milliseconds, to wait for query to complete :type client: :class:`~google.cloud.bigquery.client.Client` or ``NoneType`` diff --git a/bigquery/google/cloud/bigquery/table.py b/bigquery/google/cloud/bigquery/table.py index 6afea05f9f26..8467c8f23210 100644 --- a/bigquery/google/cloud/bigquery/table.py +++ b/bigquery/google/cloud/bigquery/table.py @@ -264,8 +264,8 @@ def description(self): def description(self, value): """Update description of the table. - :type value: str, or ``NoneType`` - :param value: new description + :type value: str + :param value: (Optional) new description :raises: ValueError for invalid value types. """ @@ -289,8 +289,8 @@ def expires(self): def expires(self, value): """Update datetime at which the table will be removed. - :type value: ``datetime.datetime``, or ``NoneType`` - :param value: the new expiration time, or None + :type value: ``datetime.datetime`` + :param value: (Optional) the new expiration time, or None """ if not isinstance(value, datetime.datetime) and value is not None: raise ValueError("Pass a datetime, or None") @@ -309,8 +309,8 @@ def friendly_name(self): def friendly_name(self, value): """Update title of the table. - :type value: str, or ``NoneType`` - :param value: new title + :type value: str + :param value: (Optional) new title :raises: ValueError for invalid value types. """ @@ -331,8 +331,8 @@ def location(self): def location(self, value): """Update location in which the table is hosted. - :type value: str, or ``NoneType`` - :param value: new location + :type value: str + :param value: (Optional) new location :raises: ValueError for invalid value types. """ @@ -554,17 +554,18 @@ def patch(self, :param client: the client to use. If not passed, falls back to the ``client`` stored on the current dataset. - :type friendly_name: str or ``NoneType`` - :param friendly_name: point in time at which the table expires. + :type friendly_name: str + :param friendly_name: (Optional) a descriptive name for this table. - :type description: str or ``NoneType`` - :param description: point in time at which the table expires. + :type description: str + :param description: (Optional) a description of this table. - :type location: str or ``NoneType`` - :param location: point in time at which the table expires. + :type location: str + :param location: + (Optional) the geographic location where the table resides. - :type expires: :class:`datetime.datetime` or ``NoneType`` - :param expires: point in time at which the table expires. + :type expires: :class:`datetime.datetime` + :param expires: (Optional) point in time at which the table expires. :type view_query: str :param view_query: SQL query defining the table as a view @@ -654,11 +655,12 @@ def fetch_data(self, max_results=None, page_token=None, client=None): incomplete. To ensure that the local copy of the schema is up-to-date, call the table's ``reload`` method. - :type max_results: int or ``NoneType`` - :param max_results: maximum number of rows to return. + :type max_results: int + :param max_results: (Optional) maximum number of rows to return. - :type page_token: str or ``NoneType`` - :param page_token: token representing a cursor into the table's rows. + :type page_token: str + :param page_token: + (Optional) token representing a cursor into the table's rows. :type client: :class:`~google.cloud.bigquery.client.Client` or ``NoneType`` @@ -714,18 +716,18 @@ def insert_data(self, :param row_ids: Unique ids, one per row being inserted. If not passed, no de-duplication occurs. - :type skip_invalid_rows: bool or ``NoneType`` - :param skip_invalid_rows: skip rows w/ invalid data? + :type skip_invalid_rows: bool + :param skip_invalid_rows: (Optional) skip rows w/ invalid data? - :type ignore_unknown_values: bool or ``NoneType`` - :param ignore_unknown_values: ignore columns beyond schema? - - :type template_suffix: str or ``NoneType`` - :param template_suffix: treat ``name`` as a template table and provide - a suffix. BigQuery will create the table - `` + `` based on the - schema of the template table. See: - https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables + :type ignore_unknown_values: bool + :param ignore_unknown_values: (Optional) ignore columns beyond schema? + + :type template_suffix: str + :param template_suffix: + (Optional) treat ``name`` as a template table and provide a suffix. + BigQuery will create the table `` + `` based + on the schema of the template table. See: + https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables :type client: :class:`~google.cloud.bigquery.client.Client` or ``NoneType`` diff --git a/core/google/cloud/_helpers.py b/core/google/cloud/_helpers.py index 1e5fd3ab9b68..449961126a69 100644 --- a/core/google/cloud/_helpers.py +++ b/core/google/cloud/_helpers.py @@ -366,8 +366,8 @@ def _microseconds_from_datetime(value): def _millis_from_datetime(value): """Convert non-none datetime to timestamp, assuming UTC. - :type value: :class:`datetime.datetime`, or None - :param value: the timestamp + :type value: :class:`datetime.datetime` + :param value: (Optional) the timestamp :rtype: int, or ``NoneType`` :returns: the timestamp, in milliseconds, or None @@ -554,8 +554,8 @@ def _name_from_project_path(path, project, template): :type path: str :param path: URI path containing the name. - :type project: str or NoneType - :param project: The project associated with the request. It is + :type project: str + :param project: (Optional) The project associated with the request. It is included for validation purposes. If passed as None, disables validation. diff --git a/core/google/cloud/connection.py b/core/google/cloud/connection.py index 02f6b8f24f6b..03e11449c558 100644 --- a/core/google/cloud/connection.py +++ b/core/google/cloud/connection.py @@ -214,11 +214,11 @@ def _make_request(self, method, url, data=None, content_type=None, :type headers: dict :param headers: A dictionary of HTTP headers to send with the request. - :type target_object: object or :class:`NoneType` - :param target_object: Argument to be used by library callers. - This can allow custom behavior, for example, to - defer an HTTP request and complete initialization - of the object at a later time. + :type target_object: object + :param target_object: + (Optional) Argument to be used by library callers. This can allow + custom behavior, for example, to defer an HTTP request and complete + initialization of the object at a later time. :rtype: tuple of ``response`` (a dictionary of sorts) and ``content`` (a string). @@ -261,9 +261,10 @@ def _do_request(self, method, url, headers, data, :type data: str :param data: The data to send as the body of the request. - :type target_object: object or :class:`NoneType` - :param target_object: Unused ``target_object`` here but may be used - by a superclass. + :type target_object: object + :param target_object: + (Optional) Unused ``target_object`` here but may be used by a + superclass. :rtype: tuple of ``response`` (a dictionary of sorts) and ``content`` (a string). @@ -323,11 +324,11 @@ def api_request(self, method, path, query_params=None, response as JSON and raise an exception if that cannot be done. Default is True. - :type _target_object: :class:`object` or :class:`NoneType` - :param _target_object: Protected argument to be used by library - callers. This can allow custom behavior, for - example, to defer an HTTP request and complete - initialization of the object at a later time. + :type _target_object: :class:`object` + :param _target_object: + (Optional) Protected argument to be used by library callers. This + can allow custom behavior, for example, to defer an HTTP request + and complete initialization of the object at a later time. :raises: Exception if the response code is not 200 OK. :rtype: dict or str diff --git a/core/google/cloud/streaming/buffered_stream.py b/core/google/cloud/streaming/buffered_stream.py index 748aa2068052..24a52176cb66 100644 --- a/core/google/cloud/streaming/buffered_stream.py +++ b/core/google/cloud/streaming/buffered_stream.py @@ -81,8 +81,10 @@ def _bytes_remaining(self): def read(self, size=None): """Read bytes from the buffer. - :type size: int or None - :param size: How many bytes to read (defaults to all remaining bytes). + :type size: int + :param size: + (Optional) How many bytes to read (defaults to all remaining + bytes). :rtype: str :returns: The data read from the stream. diff --git a/core/google/cloud/streaming/http_wrapper.py b/core/google/cloud/streaming/http_wrapper.py index 898d1b09029e..3f8d8355645d 100644 --- a/core/google/cloud/streaming/http_wrapper.py +++ b/core/google/cloud/streaming/http_wrapper.py @@ -80,8 +80,9 @@ def _httplib2_debug_level(http_request, level, http=None): :type level: int :param level: the debuglevel for logging. - :type http: :class:`httplib2.Http`, or ``None`` - :param http: the instance on whose connections to set the debuglevel. + :type http: :class:`httplib2.Http` + :param http: + (Optional) the instance on whose connections to set the debuglevel. """ if http_request.loggable_body is None: yield @@ -115,8 +116,8 @@ class Request(object): :type http_method: str :param http_method: the HTTP method to use for the request - :type headers: mapping or None - :param headers: headers to be sent with the request + :type headers: mapping + :param headers: (Optional) headers to be sent with the request :type body: str :param body: body to be sent with the request diff --git a/core/google/cloud/streaming/stream_slice.py b/core/google/cloud/streaming/stream_slice.py index bb37a4446ad5..3a13337bb993 100644 --- a/core/google/cloud/streaming/stream_slice.py +++ b/core/google/cloud/streaming/stream_slice.py @@ -65,8 +65,10 @@ def read(self, size=None): slice indicates we should still be able to read more bytes, we raise :exc:`IncompleteRead`. - :type size: int or None - :param size: If provided, read no more than size bytes from the stream. + :type size: int + :param size: + (Optional) If provided, read no more than size bytes from the + stream. :rtype: bytes :returns: bytes read from this slice. diff --git a/core/google/cloud/streaming/transfer.py b/core/google/cloud/streaming/transfer.py index b24f41144d93..410aa9430bae 100644 --- a/core/google/cloud/streaming/transfer.py +++ b/core/google/cloud/streaming/transfer.py @@ -280,8 +280,8 @@ def from_stream(cls, stream, auto_transfer=True, total_size=None, **kwds): :type stream: writable file-like object :param stream: the target file - :type total_size: int or None - :param total_size: total size of the file to be downloaded + :type total_size: int + :param total_size: (Optional) total size of the file to be downloaded :type auto_transfer: bool :param auto_transfer: should the transfer be started immediately @@ -457,8 +457,8 @@ def _compute_end_byte(self, start, end=None, use_chunks=True): :type start: int :param start: start byte of the range. - :type end: int or None - :param end: suggested last byte of the range. + :type end: int + :param end: (Optional) suggested last byte of the range. :type use_chunks: bool :param use_chunks: If False, ignore :attr:`chunksize`. @@ -493,8 +493,8 @@ def _get_chunk(self, start, end): :type start: int :param start: start byte of the range. - :type end: int or None - :param end: end byte of the range. + :type end: int + :param end: (Optional) end byte of the range. :rtype: :class:`google.cloud.streaming.http_wrapper.Response` :returns: response from the chunk request. @@ -555,8 +555,8 @@ def get_range(self, start, end=None, use_chunks=True): :type start: int :param start: Where to start fetching bytes. (See above.) - :type end: int or ``None`` - :param end: Where to stop fetching bytes. (See above.) + :type end: int + :param end: (Optional) Where to stop fetching bytes. (See above.) :type use_chunks: bool :param use_chunks: If False, ignore :attr:`chunksize` @@ -625,8 +625,8 @@ class Upload(_Transfer): :type mime_type: str: :param mime_type: MIME type of the upload. - :type total_size: int or None - :param total_size: Total upload size for the stream. + :type total_size: int + :param total_size: (Optional) Total upload size for the stream. :type http: :class:`httplib2.Http` (or workalike) :param http: Http instance used to perform requests. @@ -669,8 +669,9 @@ def from_file(cls, filename, mime_type=None, auto_transfer=True, **kwds): :type mime_type: str :param mime_type: MIMEtype of the file being uploaded - :type auto_transfer: bool or None - :param auto_transfer: should the transfer be started immediately + :type auto_transfer: bool + :param auto_transfer: + (Optional) should the transfer be started immediately :type kwds: dict :param kwds: keyword arguments: passed @@ -700,11 +701,12 @@ def from_stream(cls, stream, mime_type, :type mime_type: str :param mime_type: MIMEtype of the file being uploaded - :type total_size: int or None - :param total_size: Size of the file being uploaded + :type total_size: int + :param total_size: (Optional) Size of the file being uploaded - :type auto_transfer: bool or None - :param auto_transfer: should the transfer be started immediately + :type auto_transfer: bool + :param auto_transfer: + (Optional) should the transfer be started immediately :type kwds: dict :param kwds: keyword arguments: passed @@ -784,8 +786,8 @@ def total_size(self): def total_size(self, value): """Update total size of the stream to be uploaded. - :type value: int or None - :param value: the size + :type value: int + :param value: (Optional) the size """ self._ensure_uninitialized() self._total_size = value @@ -1048,8 +1050,8 @@ def _validate_chunksize(self, chunksize=None): Helper for :meth:`stream_file`. - :type chunksize: int or None - :param chunksize: the chunk size to be tested. + :type chunksize: int + :param chunksize: (Optional) the chunk size to be tested. :raises: :exc:`ValueError` if ``chunksize`` is not a multiple of the server-specified granulariy. diff --git a/datastore/google/cloud/datastore/connection.py b/datastore/google/cloud/datastore/connection.py index 5ee84eadf874..74070b142355 100644 --- a/datastore/google/cloud/datastore/connection.py +++ b/datastore/google/cloud/datastore/connection.py @@ -569,8 +569,8 @@ def commit(self, project, request, transaction_id): :type request: :class:`._generated.datastore_pb2.CommitRequest` :param request: The protobuf with the mutations being committed. - :type transaction_id: str or None - :param transaction_id: The transaction ID returned from + :type transaction_id: str + :param transaction_id: (Optional) The transaction ID returned from :meth:`begin_transaction`. Non-transactional batches must pass ``None``. diff --git a/datastore/google/cloud/datastore/key.py b/datastore/google/cloud/datastore/key.py index 38fe7a9d8128..d814553434ca 100644 --- a/datastore/google/cloud/datastore/key.py +++ b/datastore/google/cloud/datastore/key.py @@ -388,8 +388,8 @@ def _validate_project(project, parent): :type project: str :param project: A project. - :type parent: :class:`google.cloud.datastore.key.Key` or ``NoneType`` - :param parent: The parent of the key or ``None``. + :type parent: :class:`google.cloud.datastore.key.Key` + :param parent: (Optional) The parent of the key or ``None``. :rtype: str :returns: The ``project`` passed in, or implied from the environment. diff --git a/datastore/google/cloud/datastore/query.py b/datastore/google/cloud/datastore/query.py index ac69b4805844..8a7807496b18 100644 --- a/datastore/google/cloud/datastore/query.py +++ b/datastore/google/cloud/datastore/query.py @@ -35,16 +35,19 @@ class Query(object): :param kind: The kind to query. :type project: str - :param project: The project associated with the query. If not passed, - uses the client's value. + :param project: + (Optional) The project associated with the query. If not passed, uses + the client's value. - :type namespace: str or None - :param namespace: The namespace to which to restrict results. If not - passed, uses the client's value. + :type namespace: str + :param namespace: + (Optional) The namespace to which to restrict results. If not passed, + uses the client's value. - :type ancestor: :class:`google.cloud.datastore.key.Key` or None - :param ancestor: key of the ancestor to which this query's results are - restricted. + :type ancestor: :class:`google.cloud.datastore.key.Key` + :param ancestor: + (Optional) key of the ancestor to which this query's results are + restricted. :type filters: sequence of (property_name, operator, value) tuples :param filters: property filters applied by this query. @@ -327,17 +330,17 @@ def fetch(self, limit=None, offset=0, start_cursor=None, end_cursor=None, >>> list(query.fetch(1)) [] - :type limit: int or None - :param limit: An optional limit passed through to the iterator. + :type limit: int + :param limit: (Optional) limit passed through to the iterator. :type offset: int - :param offset: An optional offset passed through to the iterator. + :param offset: (Optional) offset passed through to the iterator. :type start_cursor: bytes - :param start_cursor: An optional cursor passed through to the iterator. + :param start_cursor: (Optional) cursor passed through to the iterator. :type end_cursor: bytes - :param end_cursor: An optional cursor passed through to the iterator. + :param end_cursor: (Optional) cursor passed through to the iterator. :type client: :class:`google.cloud.datastore.client.Client` :param client: client used to connect to datastore. diff --git a/dns/google/cloud/dns/changes.py b/dns/google/cloud/dns/changes.py index 98dd15eba963..7dad3de23e8c 100644 --- a/dns/google/cloud/dns/changes.py +++ b/dns/google/cloud/dns/changes.py @@ -169,9 +169,10 @@ def delete_record_set(self, record_set): def _require_client(self, client): """Check client or verify over-ride. - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: :class:`google.cloud.dns.client.Client` :returns: The client passed in or the currently bound client. @@ -207,9 +208,10 @@ def create(self, client=None): See: https://cloud.google.com/dns/api/v1/changes/create - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. """ if len(self.additions) == 0 and len(self.deletions) == 0: raise ValueError("No record sets added or deleted") @@ -226,9 +228,10 @@ def exists(self, client=None): See https://cloud.google.com/dns/api/v1/changes/get - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: bool :returns: Boolean indicating existence of the changes. @@ -248,9 +251,10 @@ def reload(self, client=None): See https://cloud.google.com/dns/api/v1/changes/get - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. """ client = self._require_client(client) diff --git a/dns/google/cloud/dns/client.py b/dns/google/cloud/dns/client.py index 2417bad76f16..4637c8dae1d0 100644 --- a/dns/google/cloud/dns/client.py +++ b/dns/google/cloud/dns/client.py @@ -91,13 +91,15 @@ def zone(self, name, dns_name=None, description=None): :type name: str :param name: Name of the zone. - :type dns_name: str or :class:`NoneType` - :param dns_name: DNS name of the zone. If not passed, then calls - to :meth:`zone.create` will fail. - - :type description: str or :class:`NoneType` - :param description: the description for the zone. If not passed, - defaults to the value of 'dns_name'. + :type dns_name: str + :param dns_name: + (Optional) DNS name of the zone. If not passed, then calls to + :meth:`zone.create` will fail. + + :type description: str + :param description: + (Optional) the description for the zone. If not passed, defaults + to the value of 'dns_name'. :rtype: :class:`google.cloud.dns.zone.ManagedZone` :returns: a new ``ManagedZone`` instance. diff --git a/dns/google/cloud/dns/zone.py b/dns/google/cloud/dns/zone.py index 10d656a9b74a..ec47a97027db 100644 --- a/dns/google/cloud/dns/zone.py +++ b/dns/google/cloud/dns/zone.py @@ -32,17 +32,19 @@ class ManagedZone(object): :type name: str :param name: the name of the zone - :type dns_name: str or :class:`NoneType` - :param dns_name: the DNS name of the zone. If not passed, then calls - to :meth:`create` will fail. + :type dns_name: str + :param dns_name: + (Optional) the DNS name of the zone. If not passed, then calls to + :meth:`create` will fail. :type client: :class:`google.cloud.dns.client.Client` :param client: A client which holds credentials and project configuration for the zone (which requires a project). - :type description: str or :class:`NoneType` - :param description: the description for the zone. If not passed, defaults - to the value of 'dns_name'. + :type description: str + :param description: + (Optional) the description for the zone. If not passed, defaults to + the value of 'dns_name'. """ def __init__(self, name, dns_name=None, client=None, description=None): @@ -135,8 +137,8 @@ def description(self): def description(self, value): """Update description of the zone. - :type value: str, or ``NoneType`` - :param value: new description + :type value: str + :param value: (Optional) new description :raises: ValueError for invalid value types. """ @@ -162,8 +164,8 @@ def name_server_set(self): def name_server_set(self, value): """Update named set of DNS name servers. - :type value: str, or ``NoneType`` - :param value: new title + :type value: str + :param value: (Optional) new title :raises: ValueError for invalid value types. """ @@ -202,9 +204,10 @@ def changes(self): def _require_client(self, client): """Check client or verify over-ride. - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: :class:`google.cloud.dns.client.Client` :returns: The client passed in or the currently bound client. @@ -250,9 +253,10 @@ def create(self, client=None): See: https://cloud.google.com/dns/api/v1/managedZones/create - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. """ client = self._require_client(client) path = '/projects/%s/managedZones' % (self.project,) @@ -266,9 +270,10 @@ def exists(self, client=None): See https://cloud.google.com/dns/api/v1/managedZones/get - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: bool :returns: Boolean indicating existence of the managed zone. @@ -289,9 +294,10 @@ def reload(self, client=None): See https://cloud.google.com/dns/api/v1/managedZones/get - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. """ client = self._require_client(client) @@ -305,9 +311,10 @@ def delete(self, client=None): See: https://cloud.google.com/dns/api/v1/managedZones/delete - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. """ client = self._require_client(client) client.connection.api_request(method='DELETE', path=self.path) @@ -328,9 +335,10 @@ def list_resource_record_sets(self, max_results=None, page_token=None, not passed, the API will return the first page of zones. - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: :class:`~google.cloud.iterator.Iterator` :returns: Iterator of :class:`~.resource_record_set.ResourceRecordSet` @@ -361,9 +369,10 @@ def list_changes(self, max_results=None, page_token=None, client=None): not passed, the API will return the first page of zones. - :type client: :class:`google.cloud.dns.client.Client` or ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the current zone. + :type client: :class:`google.cloud.dns.client.Client` + :param client: + (Optional) the client to use. If not passed, falls back to the + ``client`` stored on the current zone. :rtype: :class:`~google.cloud.iterator.Iterator` :returns: Iterator of :class:`~.changes.Changes` diff --git a/logging/google/cloud/logging/client.py b/logging/google/cloud/logging/client.py index ab02c90f464e..9b093dc9e131 100644 --- a/logging/google/cloud/logging/client.py +++ b/logging/google/cloud/logging/client.py @@ -139,9 +139,10 @@ def _entry_from_resource(self, resource, loggers): :type resource: dict :param resource: one entry resource from API response - :type loggers: dict or None - :param loggers: A mapping of logger fullnames -> loggers. If not - passed, the entry will have a newly-created logger. + :type loggers: dict + :param loggers: + (Optional) A mapping of logger fullnames -> loggers. If not + passed, the entry will have a newly-created logger. :rtype: One of: :class:`google.cloud.logging.entries.TextEntry`, diff --git a/logging/google/cloud/logging/entries.py b/logging/google/cloud/logging/entries.py index bbedfa113006..0de34e68ed25 100644 --- a/logging/google/cloud/logging/entries.py +++ b/logging/google/cloud/logging/entries.py @@ -56,19 +56,19 @@ class _BaseEntry(object): :type logger: :class:`google.cloud.logging.logger.Logger` :param logger: the logger used to write the entry. - :type insert_id: text, or :class:`NoneType` + :type insert_id: text :param insert_id: (optional) the ID used to identify an entry uniquely. - :type timestamp: :class:`datetime.datetime`, or :class:`NoneType` + :type timestamp: :class:`datetime.datetime` :param timestamp: (optional) timestamp for the entry - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry """ @@ -94,9 +94,10 @@ def from_api_repr(cls, resource, client, loggers=None): :param client: Client which holds credentials and project configuration. - :type loggers: dict or None - :param loggers: A mapping of logger fullnames -> loggers. If not - passed, the entry will have a newly-created logger. + :type loggers: dict + :param loggers: + (Optional) A mapping of logger fullnames -> loggers. If not + passed, the entry will have a newly-created logger. :rtype: :class:`google.cloud.logging.entries.TextEntry` :returns: Text entry parsed from ``resource``. diff --git a/logging/google/cloud/logging/logger.py b/logging/google/cloud/logging/logger.py index 38cc5110e271..d078dda29726 100644 --- a/logging/google/cloud/logging/logger.py +++ b/logging/google/cloud/logging/logger.py @@ -32,7 +32,7 @@ class Logger(object): :param client: A client which holds credentials and project configuration for the logger (which requires a project). - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of default labels for entries written via this logger. """ @@ -99,25 +99,25 @@ def _make_entry_resource(self, text=None, info=None, message=None, Only one of ``text``, ``info``, or ``message`` should be passed. - :type text: str or :class:`NoneType` - :param text: text payload + :type text: str + :param text: (Optional) text payload - :type info: dict or :class:`NoneType` - :param info: struct payload + :type info: dict + :param info: (Optional) struct payload :type message: Protobuf message or :class:`NoneType` :param message: protobuf payload - :type labels: dict or :class:`NoneType` - :param labels: labels passed in to calling method. + :type labels: dict + :param labels: (Optional) labels passed in to calling method. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry @@ -172,16 +172,16 @@ def log_text(self, text, client=None, labels=None, insert_id=None, :param client: the client to use. If not passed, falls back to the ``client`` stored on the current logger. - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry """ @@ -206,16 +206,16 @@ def log_struct(self, info, client=None, labels=None, insert_id=None, :param client: the client to use. If not passed, falls back to the ``client`` stored on the current logger. - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry. """ @@ -240,16 +240,16 @@ def log_proto(self, message, client=None, labels=None, insert_id=None, :param client: the client to use. If not passed, falls back to the ``client`` stored on the current logger. - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry. """ @@ -347,16 +347,16 @@ def log_text(self, text, labels=None, insert_id=None, severity=None, :type text: str :param text: the text entry - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry. """ @@ -370,16 +370,16 @@ def log_struct(self, info, labels=None, insert_id=None, severity=None, :type info: dict :param info: the struct entry - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry. """ @@ -393,16 +393,16 @@ def log_proto(self, message, labels=None, insert_id=None, severity=None, :type message: protobuf message :param message: the protobuf entry - :type labels: dict or :class:`NoneType` + :type labels: dict :param labels: (optional) mapping of labels for the entry. - :type insert_id: str or :class:`NoneType` + :type insert_id: str :param insert_id: (optional) unique ID for log entry. - :type severity: str or :class:`NoneType` + :type severity: str :param severity: (optional) severity of event being logged. - :type http_request: dict or :class:`NoneType` + :type http_request: dict :param http_request: (optional) info about HTTP request associated with the entry. """ diff --git a/monitoring/google/cloud/monitoring/_dataframe.py b/monitoring/google/cloud/monitoring/_dataframe.py index 5c0d89bb6ddb..6b78c7acf1f4 100644 --- a/monitoring/google/cloud/monitoring/_dataframe.py +++ b/monitoring/google/cloud/monitoring/_dataframe.py @@ -34,11 +34,11 @@ def _build_dataframe(time_series_iterable, :param time_series_iterable: An iterable (e.g., a query object) yielding time series. - :type label: str or None + :type label: str :param label: - The label name to use for the dataframe header. This can be the name - of a resource label or metric label (e.g., ``"instance_name"``), or - the string ``"resource_type"``. + (Optional) The label name to use for the dataframe header. This can be + the name of a resource label or metric label (e.g., + ``"instance_name"``), or the string ``"resource_type"``. :type labels: list of strings, or None :param labels: diff --git a/monitoring/google/cloud/monitoring/client.py b/monitoring/google/cloud/monitoring/client.py index 7bc3c31bf7d6..6a865b293e9d 100644 --- a/monitoring/google/cloud/monitoring/client.py +++ b/monitoring/google/cloud/monitoring/client.py @@ -88,8 +88,9 @@ def query(self, demonstration purposes and is subject to change. See the `supported metrics`_. - :type end_time: :class:`datetime.datetime` or None - :param end_time: The end time (inclusive) of the time interval + :type end_time: :class:`datetime.datetime` + :param end_time: + (Optional) The end time (inclusive) of the time interval for which results should be returned, as a datetime object. The default is the start of the current minute. @@ -362,15 +363,16 @@ def list_metric_descriptors(self, filter_string=None, type_prefix=None): ... type_prefix='custom.'): ... print(descriptor.type) - :type filter_string: str or None + :type filter_string: str :param filter_string: - An optional filter expression describing the metric descriptors - to be returned. See the `filter documentation`_. + (Optional) An optional filter expression describing the metric + descriptors to be returned. See the `filter documentation`_. - :type type_prefix: str or None - :param type_prefix: An optional prefix constraining the selected - metric types. This adds ``metric.type = starts_with("")`` - to the filter. + :type type_prefix: str + :param type_prefix: + (Optional) An optional prefix constraining the selected metric + types. This adds ``metric.type = starts_with("")`` to the + filter. :rtype: list of :class:`~google.cloud.monitoring.metric.MetricDescriptor` @@ -408,10 +410,10 @@ def list_resource_descriptors(self, filter_string=None): >>> for descriptor in client.list_resource_descriptors(): ... print(descriptor.type) - :type filter_string: str or None + :type filter_string: str :param filter_string: - An optional filter expression describing the resource descriptors - to be returned. See the `filter documentation`_. + (Optional) An optional filter expression describing the resource + descriptors to be returned. See the `filter documentation`_. :rtype: list of :class:`~google.cloud.monitoring.resource.ResourceDescriptor` @@ -430,22 +432,22 @@ def group(self, group_id=None, display_name=None, parent_id=None, This will not make an HTTP request; it simply instantiates a group object owned by this client. - :type group_id: str or None - :param group_id: The ID of the group. + :type group_id: str + :param group_id: (Optional) The ID of the group. - :type display_name: str or None + :type display_name: str :param display_name: - A user-assigned name for this group, used only for display - purposes. + (Optional) A user-assigned name for this group, used only for + display purposes. - :type parent_id: str or None + :type parent_id: str :param parent_id: - The ID of the group's parent, if it has one. + (Optional) The ID of the group's parent, if it has one. - :type filter_string: str or None + :type filter_string: str :param filter_string: - The filter string used to determine which monitored resources - belong to this group. + (Optional) The filter string used to determine which monitored + resources belong to this group. :type is_cluster: bool :param is_cluster: diff --git a/monitoring/google/cloud/monitoring/group.py b/monitoring/google/cloud/monitoring/group.py index 7779585301fa..d1e24c68ad2a 100644 --- a/monitoring/google/cloud/monitoring/group.py +++ b/monitoring/google/cloud/monitoring/group.py @@ -41,8 +41,8 @@ def _group_id_from_name(path, project=None): :type path: str :param path: URI path for a group API request. - :type project: str or None - :param project: The project associated with the request. It is + :type project: str + :param project: (Optional) The project associated with the request. It is included for validation purposes. :rtype: str @@ -76,21 +76,22 @@ class Group(object): :type client: :class:`google.cloud.monitoring.client.Client` :param client: A client for operating on the metric descriptor. - :type group_id: str or None - :param group_id: The ID of the group. + :type group_id: str + :param group_id: (Optional) The ID of the group. - :type display_name: str or None + :type display_name: str :param display_name: - A user-assigned name for this group, used only for display purposes. + (Optional) A user-assigned name for this group, used only for display + purposes. - :type parent_id: str or None + :type parent_id: str :param parent_id: - The ID of the group's parent, if it has one. + (Optional) The ID of the group's parent, if it has one. - :type filter_string: str or None + :type filter_string: str :param filter_string: - The filter string used to determine which monitored resources belong to - this group. + (Optional) The filter string used to determine which monitored + resources belong to this group. :type is_cluster: bool :param is_cluster: @@ -296,22 +297,23 @@ def list_members(self, filter_string=None, end_time=None, start_time=None): ... print(member) - :type filter_string: str or None + :type filter_string: str :param filter_string: - An optional list filter describing the members to be returned. The - filter may reference the type, labels, and metadata of monitored - resources that comprise the group. See the `filter documentation`_. + (Optional) An optional list filter describing the members to be + returned. The filter may reference the type, labels, and metadata + of monitored resources that comprise the group. See the `filter + documentation`_. - :type end_time: :class:`datetime.datetime` or None + :type end_time: :class:`datetime.datetime` :param end_time: - The end time (inclusive) of the time interval for which results - should be returned, as a datetime object. If ``start_time`` is - specified, then this must also be specified. + (Optional) The end time (inclusive) of the time interval for which + results should be returned, as a datetime object. If ``start_time`` + is specified, then this must also be specified. - :type start_time: :class:`datetime.datetime` or None + :type start_time: :class:`datetime.datetime` :param start_time: - The start time (exclusive) of the time interval for which results - should be returned, as a datetime object. + (Optional) The start time (exclusive) of the time interval for + which results should be returned, as a datetime object. :rtype: list of :class:`~google.cloud.monitoring.resource.Resource` :returns: A list of resource instances. @@ -386,21 +388,22 @@ def _list(cls, client, children_of_group=None, ancestors_of_group=None, :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type children_of_group: str or None + :type children_of_group: str :param children_of_group: - Returns groups whose parent_name field contains the group name. If - no groups have this parent, the results are empty. + (Optional) Returns groups whose parent_name field contains the + group name. If no groups have this parent, the results are empty. - :type ancestors_of_group: str or None + :type ancestors_of_group: str :param ancestors_of_group: - Returns groups that are ancestors of the specified group. If the - specified group has no immediate parent, the results are empty. + (Optional) Returns groups that are ancestors of the specified + group. If the specified group has no immediate parent, the results + are empty. - :type descendants_of_group: str or None + :type descendants_of_group: str :param descendants_of_group: - Returns the descendants of the specified group. This is a superset - of the results returned by the children_of_group filter, and - includes children-of-children, and so forth. + (Optional) Returns the descendants of the specified group. This is + a superset of the results returned by the children_of_group filter, + and includes children-of-children, and so forth. :rtype: list of :class:`~google.cloud.monitoring.group.Group` :returns: A list of group instances. diff --git a/monitoring/google/cloud/monitoring/metric.py b/monitoring/google/cloud/monitoring/metric.py index f2cb5c7522d0..7fc4fdde6494 100644 --- a/monitoring/google/cloud/monitoring/metric.py +++ b/monitoring/google/cloud/monitoring/metric.py @@ -102,9 +102,9 @@ class MetricDescriptor(object): :type display_name: str :param display_name: An optional concise name for the metric. - :type name: str or None + :type name: str :param name: - The "resource name" of the metric descriptor. For example: + (Optional) The "resource name" of the metric descriptor. For example: ``"projects//metricDescriptors/"``. As retrieved from the service, this will always be specified. You can and should omit it when constructing an instance for @@ -198,15 +198,15 @@ def _list(cls, client, filter_string=None, type_prefix=None): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type filter_string: str or None + :type filter_string: str :param filter_string: - An optional filter expression describing the metric descriptors - to be returned. See the `filter documentation`_. + (Optional) Filter expression describing the metric descriptors to + be returned. See the `filter documentation`_. - :type type_prefix: str or None - :param type_prefix: An optional prefix constraining the selected - metric types. This adds ``metric.type = starts_with("")`` - to the filter. + :type type_prefix: str + :param type_prefix: + (Optional) Prefix constraining the selected metric types. This adds + ``metric.type = starts_with("")`` to the filter. :rtype: list of :class:`MetricDescriptor` :returns: A list of metric descriptor instances. diff --git a/monitoring/google/cloud/monitoring/query.py b/monitoring/google/cloud/monitoring/query.py index bac9d92d9e34..964c862ec810 100644 --- a/monitoring/google/cloud/monitoring/query.py +++ b/monitoring/google/cloud/monitoring/query.py @@ -86,8 +86,8 @@ class Query(object): demonstration purposes and is subject to change. See the `supported metrics`_. - :type end_time: :class:`datetime.datetime` or None - :param end_time: The end time (inclusive) of the time interval + :type end_time: :class:`datetime.datetime` + :param end_time: (Optional) The end time (inclusive) of the time interval for which results should be returned, as a datetime object. The default is the start of the current minute. @@ -179,8 +179,9 @@ def select_interval(self, end_time, start_time=None): :param end_time: The end time (inclusive) of the time interval for which results should be returned, as a datetime object. - :type start_time: :class:`datetime.datetime` or None - :param start_time: The start time (exclusive) of the time interval + :type start_time: :class:`datetime.datetime` + :param start_time: + (Optional) The start time (exclusive) of the time interval for which results should be returned, as a datetime object. If not specified, the interval is a point in time. @@ -446,11 +447,11 @@ def iter(self, headers_only=False, page_size=None): :param headers_only: Whether to omit the point data from the time series objects. - :type page_size: int or None + :type page_size: int :param page_size: - An optional positive number specifying the maximum number of - points to return per page. This can be used to control how far - the iterator reads ahead. + (Optional) Positive number specifying the maximum number of points + to return per page. This can be used to control how far the + iterator reads ahead. :raises: :exc:`ValueError` if the query time interval has not been specified. @@ -510,11 +511,12 @@ def _build_query_params(self, headers_only=False, Whether to omit the point data from the :class:`~google.cloud.monitoring.timeseries.TimeSeries` objects. - :type page_size: int or None - :param page_size: A limit on the number of points to return per page. + :type page_size: int + :param page_size: + (Optional) A limit on the number of points to return per page. - :type page_token: str or None - :param page_token: A token to continue the retrieval. + :type page_token: str + :param page_token: (Optional) A token to continue the retrieval. """ yield 'filter', self.filter @@ -575,8 +577,9 @@ def as_dataframe(self, label=None, labels=None): dataframe = query.as_dataframe( labels=['resource_type', 'instance_id']) - :type label: str or None - :param label: The label name to use for the dataframe header. + :type label: str + :param label: + (Optional) The label name to use for the dataframe header. This can be the name of a resource label or metric label (e.g., ``"instance_name"``), or the string ``"resource_type"``. diff --git a/monitoring/google/cloud/monitoring/resource.py b/monitoring/google/cloud/monitoring/resource.py index e951006c1cf5..3a1eba70e043 100644 --- a/monitoring/google/cloud/monitoring/resource.py +++ b/monitoring/google/cloud/monitoring/resource.py @@ -88,10 +88,10 @@ def _list(cls, client, filter_string=None): :type client: :class:`google.cloud.monitoring.client.Client` :param client: The client to use. - :type filter_string: str or None + :type filter_string: str :param filter_string: - An optional filter expression describing the resource descriptors - to be returned. See the `filter documentation`_. + (Optional) An optional filter expression describing the resource + descriptors to be returned. See the `filter documentation`_. :rtype: list of :class:`ResourceDescriptor` :returns: A list of resource descriptor instances. diff --git a/monitoring/google/cloud/monitoring/timeseries.py b/monitoring/google/cloud/monitoring/timeseries.py index b46e5d830265..a8b9551f1b6c 100644 --- a/monitoring/google/cloud/monitoring/timeseries.py +++ b/monitoring/google/cloud/monitoring/timeseries.py @@ -179,8 +179,8 @@ class Point(collections.namedtuple('Point', 'end_time start_time value')): :type end_time: str :param end_time: The end time in RFC3339 UTC "Zulu" format. - :type start_time: str or None - :param start_time: An optional start time in RFC3339 UTC "Zulu" format. + :type start_time: str + :param start_time: (Optional) The start time in RFC3339 UTC "Zulu" format. :type value: object :param value: The metric value. This can be a scalar or a distribution. diff --git a/pubsub/google/cloud/pubsub/_gax.py b/pubsub/google/cloud/pubsub/_gax.py index d346cf526c63..23ecb55f6024 100644 --- a/pubsub/google/cloud/pubsub/_gax.py +++ b/pubsub/google/cloud/pubsub/_gax.py @@ -269,14 +269,15 @@ def subscription_create(self, subscription_path, topic_path, subscribed, in format ``projects//topics/``. - :type ack_deadline: int, or ``NoneType`` - :param ack_deadline: the deadline (in seconds) by which messages pulled - from the back-end must be acknowledged. + :type ack_deadline: int + :param ack_deadline: + (Optional) the deadline (in seconds) by which messages pulled from + the back-end must be acknowledged. - :type push_endpoint: str, or ``NoneType`` - :param push_endpoint: URL to which messages will be pushed by the - back-end. If not set, the application must pull - messages. + :type push_endpoint: str + :param push_endpoint: + (Optional) URL to which messages will be pushed by the back-end. + If not set, the application must pull messages. :rtype: dict :returns: ``Subscription`` resource returned from the API. @@ -351,10 +352,10 @@ def subscription_modify_push_config(self, subscription_path, the fully-qualified path of the new subscription, in format ``projects//subscriptions/``. - :type push_endpoint: str, or ``NoneType`` - :param push_endpoint: URL to which messages will be pushed by the - back-end. If not set, the application must pull - messages. + :type push_endpoint: str + :param push_endpoint: + (Optional) URL to which messages will be pushed by the back-end. + If not set, the application must pull messages. """ push_config = PushConfig(push_endpoint=push_endpoint) try: diff --git a/pubsub/google/cloud/pubsub/connection.py b/pubsub/google/cloud/pubsub/connection.py index e854495b3682..85ce000dea91 100644 --- a/pubsub/google/cloud/pubsub/connection.py +++ b/pubsub/google/cloud/pubsub/connection.py @@ -309,14 +309,15 @@ def subscription_create(self, subscription_path, topic_path, subscribed, in format ``projects//topics/``. - :type ack_deadline: int, or ``NoneType`` - :param ack_deadline: the deadline (in seconds) by which messages pulled - from the back-end must be acknowledged. + :type ack_deadline: int + :param ack_deadline: + (Optional) the deadline (in seconds) by which messages pulled from + the back-end must be acknowledged. - :type push_endpoint: str, or ``NoneType`` - :param push_endpoint: URL to which messages will be pushed by the - back-end. If not set, the application must pull - messages. + :type push_endpoint: str + :param push_endpoint: + (Optional) URL to which messages will be pushed by the back-end. + If not set, the application must pull messages. :rtype: dict :returns: ``Subscription`` resource returned from the API. @@ -378,10 +379,10 @@ def subscription_modify_push_config(self, subscription_path, the fully-qualified path of the new subscription, in format ``projects//subscriptions/``. - :type push_endpoint: str, or ``NoneType`` - :param push_endpoint: URL to which messages will be pushed by the - back-end. If not set, the application must pull - messages. + :type push_endpoint: str + :param push_endpoint: + (Optional) URL to which messages will be pushed by the back-end. + If not set, the application must pull messages. """ conn = self._connection path = '/%s:modifyPushConfig' % (subscription_path,) diff --git a/pubsub/google/cloud/pubsub/message.py b/pubsub/google/cloud/pubsub/message.py index 8fd65b48785a..89ce690eccec 100644 --- a/pubsub/google/cloud/pubsub/message.py +++ b/pubsub/google/cloud/pubsub/message.py @@ -32,9 +32,9 @@ class Message(object): :type message_id: str :param message_id: An ID assigned to the message by the API. - :type attributes: dict or None - :param attributes: Extra metadata associated by the publisher with the - message. + :type attributes: dict + :param attributes: + (Optional) Extra metadata associated by the publisher with the message. """ _service_timestamp = None @@ -80,8 +80,8 @@ def service_timestamp(self): def from_api_repr(cls, api_repr): """Factory: construct message from API representation. - :type api_repr: dict or None - :param api_repr: The API representation of the message + :type api_repr: dict + :param api_repr: (Optional) The API representation of the message :rtype: :class:`Message` :returns: The message created from the response. diff --git a/pubsub/google/cloud/pubsub/subscription.py b/pubsub/google/cloud/pubsub/subscription.py index 79d9400bdc86..c98277d660df 100644 --- a/pubsub/google/cloud/pubsub/subscription.py +++ b/pubsub/google/cloud/pubsub/subscription.py @@ -29,22 +29,24 @@ class Subscription(object): :type name: str :param name: the name of the subscription. - :type topic: :class:`google.cloud.pubsub.topic.Topic` or ``NoneType`` - :param topic: the topic to which the subscription belongs; if ``None``, - the subscription's topic has been deleted. + :type topic: :class:`google.cloud.pubsub.topic.Topic` + :param topic: + (Optional) the topic to which the subscription belongs; if ``None``, + the subscription's topic has been deleted. :type ack_deadline: int :param ack_deadline: the deadline (in seconds) by which messages pulled from the back-end must be acknowledged. :type push_endpoint: str - :param push_endpoint: URL to which messages will be pushed by the back-end. - If not set, the application must pull messages. - - :type client: :class:`~google.cloud.pubsub.client.Client` or - ``NoneType`` - :param client: the client to use. If not passed, falls back to the - ``client`` stored on the topic. + :param push_endpoint: + (Optional) URL to which messages will be pushed by the back-end. If + not set, the application must pull messages. + + :type client: :class:`~google.cloud.pubsub.client.Client` + :param client: + (Optional) The client to use. If not passed, falls back to the + ``client`` stored on the topic. """ _DELETED_TOPIC_PATH = '_deleted-topic_' @@ -81,9 +83,10 @@ def from_api_repr(cls, resource, client, topics=None): :param client: Client which holds credentials and project configuration for a topic. - :type topics: dict or None - :param topics: A mapping of topic names -> topics. If not passed, - the subscription will have a newly-created topic. + :type topics: dict + :param topics: + (Optional) A mapping of topic names -> topics. If not passed, the + subscription will have a newly-created topic. :rtype: :class:`google.cloud.pubsub.subscription.Subscription` :returns: Subscription parsed from ``resource``. diff --git a/scripts/run_pylint.py b/scripts/run_pylint.py index c18204c50e3c..9b4c77883a57 100644 --- a/scripts/run_pylint.py +++ b/scripts/run_pylint.py @@ -147,7 +147,7 @@ def get_python_files(all_files=None): NOTE: This requires ``git`` to be installed and requires that this is run within the ``git`` repository. - :type all_files: list or ``NoneType`` + :type all_files: list :param all_files: Optional list of files to be linted. :rtype: tuple diff --git a/storage/google/cloud/storage/acl.py b/storage/google/cloud/storage/acl.py index ce11dd859863..4e40348e98bc 100644 --- a/storage/google/cloud/storage/acl.py +++ b/storage/google/cloud/storage/acl.py @@ -419,10 +419,10 @@ def _save(self, acl, predefined, client): :param acl: The ACL object to save. If left blank, this will save current entries. - :type predefined: str or None - :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 predefined: str + :param predefined: + (Optional) 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`` diff --git a/storage/google/cloud/storage/batch.py b/storage/google/cloud/storage/batch.py index 7c52ce1a6cf3..c07dce0e023e 100644 --- a/storage/google/cloud/storage/batch.py +++ b/storage/google/cloud/storage/batch.py @@ -44,8 +44,8 @@ class MIMEApplicationHTTP(MIMEApplication): :type headers: dict :param headers: HTTP headers - :type body: str or None - :param body: HTTP payload + :type body: str + :param body: (Optional) HTTP payload """ def __init__(self, method, uri, headers, body): @@ -154,11 +154,11 @@ def _do_request(self, method, url, headers, data, target_object): :type data: str :param data: The data to send as the body of the request. - :type target_object: object or :class:`NoneType` - :param target_object: This allows us to enable custom behavior in our - batch connection. Here we defer an HTTP request - and complete initialization of the object at a - later time. + :type target_object: object + :param target_object: + (Optional) This allows us to enable custom behavior in our batch + connection. Here we defer an HTTP request and complete + initialization of the object at a later time. :rtype: tuple of ``response`` (a dictionary of sorts) and ``content`` (a string). diff --git a/storage/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py index 145b5417c98f..16da5782fef5 100644 --- a/storage/google/cloud/storage/blob.py +++ b/storage/google/cloud/storage/blob.py @@ -94,8 +94,8 @@ def chunk_size(self): def chunk_size(self, value): """Set the blob's default chunk size. - :type value: int or ``NoneType`` - :param value: The current blob's chunk size, if it is set. + :type value: int + :param value: (Optional) The current blob's chunk size, if it is set. :raises: :class:`ValueError` if ``value`` is not ``None`` and is not a multiple of 256 KB. @@ -450,7 +450,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None, :func:`os.fstat`. (If the file handle is not from the filesystem this won't be possible.) - :type content_type: str or ``NoneType`` + :type content_type: str :param content_type: Optional type of content being uploaded. :type num_retries: int @@ -567,7 +567,7 @@ def upload_from_filename(self, filename, content_type=None, client=None): :type filename: str :param filename: The path to the file. - :type content_type: str or ``NoneType`` + :type content_type: str :param content_type: Optional type of content being uploaded. :type client: :class:`~google.cloud.storage.client.Client` or @@ -861,8 +861,8 @@ def metadata(self, value): See: https://cloud.google.com/storage/docs/json_api/v1/objects - :type value: dict or ``NoneType`` - :param value: The blob metadata to set. + :type value: dict + :param value: (Optional) The blob metadata to set. """ self._patch_property('metadata', value) diff --git a/storage/google/cloud/storage/client.py b/storage/google/cloud/storage/client.py index f764e98ab8e9..721f5dd962ec 100644 --- a/storage/google/cloud/storage/client.py +++ b/storage/google/cloud/storage/client.py @@ -227,28 +227,29 @@ def list_buckets(self, max_results=None, page_token=None, prefix=None, This implements "storage.buckets.list". - :type max_results: int or ``NoneType`` + :type max_results: int :param max_results: Optional. Maximum number of buckets to return. - :type page_token: str or ``NoneType`` + :type page_token: str :param page_token: Optional. Opaque marker for the next "page" of buckets. If not passed, will return the first page of buckets. - :type prefix: str or ``NoneType`` + :type prefix: str :param prefix: Optional. Filter results to buckets whose names begin with this prefix. - :type projection: str or ``NoneType`` - :param projection: If used, must be 'full' or 'noAcl'. Defaults to - 'noAcl'. Specifies the set of properties to return. - - :type fields: str or ``NoneType`` - :param fields: Selector specifying which fields to include in a - partial response. Must be a list of fields. For example - to get a partial response with just the next page token - and the language of each bucket returned: - 'items/id,nextPageToken' + :type projection: str + :param projection: + (Optional) Specifies the set of properties to return. If used, must + be 'full' or 'noAcl'. Defaults to 'noAcl'. + + :type fields: str + :param fields: + (Optional) Selector specifying which fields to include in a partial + response. Must be a list of fields. For example to get a partial + response with just the next page token and the language of each + bucket returned: 'items/id,nextPageToken' :rtype: :class:`~google.cloud.iterator.Iterator` :returns: Iterator of all :class:`~google.cloud.storage.bucket.Bucket`