@@ -46,38 +46,51 @@ def get_credentials():
4646 """Gets credentials implicitly from the current environment.
4747
4848 .. note::
49- You should not need to use this function directly. Instead, use the
50- helper method :func:`gcloud.datastore.__init__.get_connection`
51- which uses this method under the hood.
49+
50+ You should not need to use this function directly. Instead, use a
51+ helper method which uses this method under the hood.
5252
5353 Checks environment in order of precedence:
5454
5555 * Google App Engine (production and testing)
56- * Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
56+ * Environment variable `` GOOGLE_APPLICATION_CREDENTIALS`` pointing to
5757 a file with stored credentials information.
5858 * Stored "well known" file associated with ``gcloud`` command line tool.
5959 * Google Compute Engine production environment.
6060
61- The file referred to in GOOGLE_APPLICATION_CREDENTIALS is expected to
61+ The file referred to in `` GOOGLE_APPLICATION_CREDENTIALS`` is expected to
6262 contain information about credentials that are ready to use. This means
6363 either service account information or user account information with
64- a ready-to-use refresh token::
64+ a ready-to-use refresh token:
65+
66+ .. code:: json
67+
68+ {
69+ 'type': 'authorized_user',
70+ 'client_id': '...',
71+ 'client_secret': '...',
72+ 'refresh_token': '...'
73+ }
6574
66- { {
67- 'type': 'authorized_user', 'type': 'service_account',
68- 'client_id': '...', 'client_id': '...',
69- 'client_secret': '...', OR 'client_email': '...',
70- 'refresh_token': '..., 'private_key_id': '...',
71- } 'private_key': '...',
72- }
75+ or
76+
77+ .. code:: json
78+
79+ {
80+ 'type': 'service_account',
81+ 'client_id': '...',
82+ 'client_email': '...',
83+ 'private_key_id': '...',
84+ 'private_key': '...'
85+ }
7386
7487 The second of these is simply a JSON key downloaded from the Google APIs
7588 console. The first is a close cousin of the "client secrets" JSON file
76- used by `` oauth2client.clientsecrets` ` but differs in formatting.
89+ used by :mod:` oauth2client.clientsecrets` but differs in formatting.
7790
7891 :rtype: :class:`oauth2client.client.GoogleCredentials`,
79- :class:`oauth2client.appengine.AppAssertionCredentials`,
80- :class:`oauth2client.gce.AppAssertionCredentials`,
92+ :class:`oauth2client.contrib. appengine.AppAssertionCredentials`,
93+ :class:`oauth2client.contrib. gce.AppAssertionCredentials`,
8194 :class:`oauth2client.service_account._ServiceAccountCredentials`
8295 :returns: A new credentials instance corresponding to the implicit
8396 environment.
@@ -119,7 +132,7 @@ def get_for_service_account_p12(client_email, private_key_path, scope=None):
119132
120133 .. note::
121134 This method is not used by default, instead :func:`get_credentials`
122- is used. This method is intended to be used when the environments is
135+ is used. This method is intended to be used when the environment is
123136 known explicitly and detecting the environment implicitly would be
124137 superfluous.
125138
@@ -302,7 +315,8 @@ def generate_signed_url(credentials, resource, expiration,
302315 :param resource: A pointer to a specific resource
303316 (typically, ``/bucket-name/path/to/blob.txt``).
304317
305- :type expiration: int, long, datetime.datetime, datetime.timedelta
318+ :type expiration: :class:`int`, :class:`long`, :class:`datetime.datetime`,
319+ :class:`datetime.timedelta`
306320 :param expiration: When the signed URL should expire.
307321
308322 :type api_access_endpoint: string
0 commit comments