build: fix warnings in docgen (#711)
Resolved all the outstanding warnings from sphinx.
Going forward, warnings will be treated as errors since the `-W` flag is being used with `sphinx-build`
diff --git a/google/oauth2/_service_account_async.py b/google/oauth2/_service_account_async.py
index 0a4e724..cfd315a 100644
--- a/google/oauth2/_service_account_async.py
+++ b/google/oauth2/_service_account_async.py
@@ -112,7 +112,7 @@
'service-account.json',
scopes=['email'],
subject='user@example.com'))
-`
+
The credentials are considered immutable. If you want to modify the scopes
or the subject used for delegation, use :meth:`with_scopes` or
:meth:`with_subject`::
diff --git a/google/oauth2/id_token.py b/google/oauth2/id_token.py
index d70782b..5e36260 100644
--- a/google/oauth2/id_token.py
+++ b/google/oauth2/id_token.py
@@ -50,7 +50,7 @@
cached_session = cachecontrol.CacheControl(session)
request = google.auth.transport.requests.Request(session=cached_session)
-.. _OpenID Connect ID Token:
+.. _OpenID Connect ID Tokens:
http://openid.net/specs/openid-connect-core-1_0.html#IDToken
.. _CacheControl: https://cachecontrol.readthedocs.io
"""
diff --git a/google/oauth2/service_account.py b/google/oauth2/service_account.py
index ed91011..1ccfa19 100644
--- a/google/oauth2/service_account.py
+++ b/google/oauth2/service_account.py
@@ -424,6 +424,7 @@
service_account.IDTokenCredentials.from_service_account_file(
'service-account.json'))
+
Or if you already have the service account file loaded::
service_account_info = json.load(open('service_account.json'))
@@ -431,6 +432,7 @@
service_account.IDTokenCredentials.from_service_account_info(
service_account_info))
+
Both helper methods pass on arguments to the constructor, so you can
specify additional scopes and a subject if necessary::
@@ -439,7 +441,8 @@
'service-account.json',
scopes=['email'],
subject='user@example.com'))
-`
+
+
The credentials are considered immutable. If you want to modify the scopes
or the subject used for delegation, use :meth:`with_scopes` or
:meth:`with_subject`::
diff --git a/google/oauth2/utils.py b/google/oauth2/utils.py
index efda796..593f032 100644
--- a/google/oauth2/utils.py
+++ b/google/oauth2/utils.py
@@ -101,7 +101,7 @@
Args:
headers (Mapping[str, str]): The HTTP request header.
- request_body (Optional[Mapping[str, str]): The HTTP request body
+ request_body (Optional[Mapping[str, str]]): The HTTP request body
dictionary. For requests that do not support request body, this
is None and will be ignored.
bearer_token (Optional[str]): The optional bearer token.