From 0af43cd3b296ba7c6d7c0e158db6f89b6a8ea3ae Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Wed, 28 Dec 2016 09:33:52 -0500 Subject: [PATCH] Remove API key from Translate usage docs. --- docs/translate-usage.rst | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/translate-usage.rst b/docs/translate-usage.rst index 54c86a37d706..10456cbefcbe 100644 --- a/docs/translate-usage.rst +++ b/docs/translate-usage.rst @@ -13,12 +13,8 @@ Authentication / Configuration - Use :class:`~google.cloud.translate.client.Client` objects to configure your applications. -- :class:`~google.cloud.translate.client.Client` objects hold both a ``key`` - and a connection to the Cloud Translation service. - -- **An API key is required for Google Cloud Translation.** See - `Identifying your application to Google`_ for details. This is - significantly different than the other clients in ``google-cloud-python``. +- :class:`~google.cloud.translate.client.Client` objects hold + a connection to the Cloud Translation service. Methods ------- @@ -28,7 +24,7 @@ To create a client: .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key') + >>> client = translate.Client() By default, the client targets English when doing detections and translations, but a non-default value can be used as @@ -37,7 +33,7 @@ well: .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key', target_language='es') + >>> client = translate.Client(target_language='es') The Google Cloud Translation API has three supported methods, and they map to three methods on a client: @@ -50,7 +46,7 @@ To get a list of languages supported by the Google Cloud Translation API .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key') + >>> client = translate.Client() >>> client.get_languages() [ { @@ -65,7 +61,7 @@ To detect the language that some given text is written in: .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key') + >>> client = translate.Client() >>> client.detect_language(['Me llamo', 'I am']) [ { @@ -88,7 +84,7 @@ To translate text: .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key') + >>> client = translate.Client() >>> client.translate('koszula') { 'translatedText': 'shirt', @@ -101,7 +97,7 @@ or to use a non-default target language: .. code:: >>> from google.cloud import translate - >>> client = translate.Client('my-api-key') + >>> client = translate.Client() >>> client.translate(['Me llamo Jeff', 'My name is Jeff'], ... target_language='de') [