Skip to content

Commit

Permalink
Replace string with str in rtypes.
Browse files Browse the repository at this point in the history
Used the command:
ag -l 'rtype: string' | xargs sed -i .bak 's/rtype: string/rtype: str/g'

Based on this comment:
googleapis#2485 (comment)

`str` is a type, `string` is a module.
  • Loading branch information
tswast committed Oct 20, 2016
1 parent 881a953 commit 01b494c
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 75 deletions.
16 changes: 8 additions & 8 deletions bigquery/google/cloud/bigquery/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, name, client, access_grants=()):
def project(self):
"""Project bound to the dataset.
:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand All @@ -124,7 +124,7 @@ def project(self):
def path(self):
"""URL path for the dataset's APIs.
:rtype: string
:rtype: str
:returns: the path based on project and dataste name.
"""
return '/projects/%s/datasets/%s' % (self.project, self.name)
Expand Down Expand Up @@ -168,7 +168,7 @@ def created(self):
def dataset_id(self):
"""ID for the dataset resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ID (None until set from the server).
"""
return self._properties.get('id')
Expand All @@ -177,7 +177,7 @@ def dataset_id(self):
def etag(self):
"""ETag for the dataset resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ETag (None until set from the server).
"""
return self._properties.get('etag')
Expand All @@ -198,7 +198,7 @@ def modified(self):
def self_link(self):
"""URL for the dataset resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('selfLink')
Expand Down Expand Up @@ -229,7 +229,7 @@ def default_table_expiration_ms(self, value):
def description(self):
"""Description of the dataset.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The description as set by the user, or None (the default).
"""
return self._properties.get('description')
Expand All @@ -251,7 +251,7 @@ def description(self, value):
def friendly_name(self):
"""Title of the dataset.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The name as set by the user, or None (the default).
"""
return self._properties.get('friendlyName')
Expand All @@ -273,7 +273,7 @@ def friendly_name(self, value):
def location(self):
"""Location in which the dataset is hosted.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The location as set by the user, or None (the default).
"""
return self._properties.get('location')
Expand Down
14 changes: 7 additions & 7 deletions bigquery/google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, client):
def project(self):
"""Project bound to the job.
:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(self, name, client):
def job_type(self):
"""Type of job
:rtype: string
:rtype: str
:returns: one of 'load', 'copy', 'extract', 'query'
"""
return self._JOB_TYPE
Expand All @@ -144,7 +144,7 @@ def job_type(self):
def path(self):
"""URL path for the job's APIs.
:rtype: string
:rtype: str
:returns: the path based on project and job name.
"""
return '/projects/%s/jobs/%s' % (self.project, self.name)
Expand All @@ -153,7 +153,7 @@ def path(self):
def etag(self):
"""ETag for the job resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ETag (None until set from the server).
"""
return self._properties.get('etag')
Expand All @@ -162,7 +162,7 @@ def etag(self):
def self_link(self):
"""URL for the job resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('selfLink')
Expand All @@ -171,7 +171,7 @@ def self_link(self):
def user_email(self):
"""E-mail address of user who submitted the job.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('user_email')
Expand Down Expand Up @@ -241,7 +241,7 @@ def errors(self):
def state(self):
"""Status of the job.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the state (None until set from the server).
"""
status = self._properties.get('status')
Expand Down
4 changes: 2 additions & 2 deletions bigquery/google/cloud/bigquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def from_query_job(cls, job):
def project(self):
"""Project bound to the job.
:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand Down Expand Up @@ -185,7 +185,7 @@ def page_token(self):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#pageToken
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: Token generated on the server (None until set by the server).
"""
return self._properties.get('pageToken')
Expand Down
2 changes: 1 addition & 1 deletion core/google/cloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def _pb_timestamp_to_rfc3339(timestamp_pb):
:type timestamp_pb: :class:`google.protobuf.timestamp_pb2.Timestamp`
:param timestamp_pb: A Google returned timestamp protobuf.
:rtype: string
:rtype: str
:returns: An RFC 3339 formatted timestamp string.
"""
timestamp = _pb_timestamp_to_datetime(timestamp_pb)
Expand Down
2 changes: 1 addition & 1 deletion core/google/cloud/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def build_api_url(cls, path, query_params=None,
Typically you shouldn't provide this and instead
use the default for the library.
:rtype: string
:rtype: str
:returns: The URL assembled from the pieces provided.
"""
url = cls.API_URL_TEMPLATE.format(
Expand Down
2 changes: 1 addition & 1 deletion core/google/cloud/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def generate_signed_url(credentials, resource, expiration,
:param generation: (Optional) A value that indicates which generation of
the resource to fetch.
:rtype: string
:rtype: str
:returns: A signed URL you can use to access the resource
until expiration.
"""
Expand Down
10 changes: 5 additions & 5 deletions core/google/cloud/streaming/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def stream(self):
def url(self):
"""URL to / from which data is downloaded/uploaded.
:rtype: string
:rtype: str
:returns: The URL where data is sent/received.
"""
return self._url
Expand Down Expand Up @@ -318,7 +318,7 @@ def total_size(self):
def encoding(self):
"""'Content-Encoding' used to transfer the file
:rtype: string or None
:rtype: str or None
:returns: The encoding of the downloaded content.
"""
return self._encoding
Expand Down Expand Up @@ -732,7 +732,7 @@ def complete(self):
def mime_type(self):
"""MIMEtype of the file being uploaded.
:rtype: string
:rtype: str
:returns: The mime-type of the upload.
"""
return self._mime_type
Expand All @@ -750,7 +750,7 @@ def progress(self):
def strategy(self):
"""Upload strategy to use
:rtype: string or None
:rtype: str or None
:returns: The strategy used to upload the data.
"""
return self._strategy
Expand Down Expand Up @@ -972,7 +972,7 @@ def _get_range_header(response):
:type response: :class:`google.cloud.streaming.http_wrapper.Response`
:param response: response to be queried
:rtype: string
:rtype: str
:returns: The header used to determine the bytes range.
"""
# NOTE: Per RFC 2616[1]/7233[2][3], 'Range' is a request header,
Expand Down
2 changes: 1 addition & 1 deletion datastore/google/cloud/datastore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _determine_default_project(project=None):
:type project: string
:param project: Optional. The project to use as default.
:rtype: string or ``NoneType``
:rtype: str or ``NoneType``
:returns: Default project if it can be determined.
"""
if project is None:
Expand Down
2 changes: 1 addition & 1 deletion datastore/google/cloud/datastore/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _request(self, project, method, data):
:param data: The data to send with the API call.
Typically this is a serialized Protobuf string.
:rtype: string
:rtype: str
:returns: The string response content from the API call.
:raises: :class:`google.cloud.exceptions.GoogleCloudError` if the
response code is not 200 OK.
Expand Down
10 changes: 5 additions & 5 deletions datastore/google/cloud/datastore/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def is_partial(self):
def namespace(self):
"""Namespace getter.
:rtype: string
:rtype: str
:returns: The namespace of the current key.
"""
return self._namespace
Expand Down Expand Up @@ -298,7 +298,7 @@ def flat_path(self):
def kind(self):
"""Kind getter. Based on the last element of path.
:rtype: string
:rtype: str
:returns: The kind of the current key.
"""
return self.path[-1]['kind']
Expand All @@ -316,7 +316,7 @@ def id(self):
def name(self):
"""Name getter. Based on the last element of path.
:rtype: string
:rtype: str
:returns: The (string) name of the key.
"""
return self.path[-1].get('name')
Expand All @@ -335,7 +335,7 @@ def id_or_name(self):
def project(self):
"""Project getter.
:rtype: string
:rtype: str
:returns: The key's project.
"""
return self._project
Expand Down Expand Up @@ -391,7 +391,7 @@ def _validate_project(project, parent):
:type parent: :class:`google.cloud.datastore.key.Key` or ``NoneType``
:param parent: The parent of the key or ``None``.
:rtype: string
:rtype: str
:returns: The ``project`` passed in, or implied from the environment.
:raises: :class:`ValueError` if ``project`` is ``None`` and no project
can be inferred from the parent.
Expand Down
4 changes: 2 additions & 2 deletions datastore/google/cloud/datastore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def project(self):
def namespace(self):
"""This query's namespace
:rtype: string or None
:rtype: str or None
:returns: the namespace assigned to this query
"""
return self._namespace or self._client.namespace
Expand All @@ -128,7 +128,7 @@ def namespace(self, value):
def kind(self):
"""Get the Kind of the Query.
:rtype: string
:rtype: str
:returns: The kind for the query.
"""
return self._kind
Expand Down
2 changes: 1 addition & 1 deletion datastore/google/cloud/datastore/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, client):
def id(self):
"""Getter for the transaction ID.
:rtype: string
:rtype: str
:returns: The ID of the current transaction.
"""
return self._id
Expand Down
6 changes: 3 additions & 3 deletions dns/google/cloud/dns/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _set_properties(self, resource):
def path(self):
"""URL path for change set APIs.
:rtype: string
:rtype: str
:returns: the path based on project, zone, and change set names.
"""
return '/projects/%s/managedZones/%s/changes/%s' % (
Expand All @@ -84,7 +84,7 @@ def path(self):
def name(self):
"""Name of the change set.
:rtype: string or ``NoneType``
:rtype: str or ``NoneType``
:returns: Name, as set by the back-end, or None.
"""
return self._properties.get('id')
Expand All @@ -104,7 +104,7 @@ def name(self, value):
def status(self):
"""Status of the change set.
:rtype: string or ``NoneType``
:rtype: str or ``NoneType``
:returns: Status, as set by the back-end, or None.
"""
return self._properties.get('status')
Expand Down
10 changes: 5 additions & 5 deletions dns/google/cloud/dns/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def from_api_repr(cls, resource, client):
def project(self):
"""Project bound to the zone.
:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand All @@ -90,7 +90,7 @@ def project(self):
def path(self):
"""URL path for the zone's APIs.
:rtype: string
:rtype: str
:returns: the path based on project and dataste name.
"""
return '/projects/%s/managedZones/%s' % (self.project, self.name)
Expand All @@ -117,7 +117,7 @@ def name_servers(self):
def zone_id(self):
"""ID for the zone resource.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ID (None until set from the server).
"""
return self._properties.get('id')
Expand All @@ -126,7 +126,7 @@ def zone_id(self):
def description(self):
"""Description of the zone.
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The description as set by the user, or None (the default).
"""
return self._properties.get('description')
Expand All @@ -153,7 +153,7 @@ def name_server_set(self):
See:
https://cloud.google.com/dns/api/v1/managedZones#nameServerSet
:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The name as set by the user, or None (the default).
"""
return self._properties.get('nameServerSet')
Expand Down
Loading

0 comments on commit 01b494c

Please sign in to comment.