{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments/79430572","id":79430572,"diff_hunk":"@@ -0,0 +1,157 @@\n+# Copyright 2016 Google Inc. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"Basic client for Google Cloud Speech API.\"\"\"\n+from base64 import b64encode\n+\n+from google.cloud._helpers import _to_bytes\n+from google.cloud import client as client_module\n+from google.cloud.speech.connection import Connection\n+\n+\n+class Encoding(object):\n+    \"\"\"Audio encoding types.\"\"\"\n+\n+    LINEAR16 = 'LINEAR16'\n+    \"\"\"LINEAR16 encoding type.\"\"\"\n+\n+    FLAC = 'FLAC'\n+    \"\"\"FLAC encoding type.\"\"\"\n+\n+    MULAW = 'MULAW'\n+    \"\"\"MULAW encoding type.\"\"\"\n+\n+    AMR = 'AMR'\n+    \"\"\"AMR encoding type.\"\"\"\n+\n+    AMR_WB = 'AMR_WB'\n+    \"\"\"AMR_WB encoding type.\"\"\"\n+\n+\n+class Client(client_module.Client):\n+    \"\"\"Client to bundle configuration needed for API requests.\n+\n+    :type project: str\n+    :param project: the project which the client acts on behalf of. Will be\n+                    passed when creating a dataset / job.  If not passed,\n+                    falls back to the default inferred from the environment.\n+\n+    :type credentials: :class:`oauth2client.client.OAuth2Credentials` or\n+                       :class:`NoneType`\n+    :param credentials: The OAuth2 Credentials to use for the connection\n+                        owned by this client. If not passed (and if no ``http``\n+                        object is passed), falls back to the default inferred\n+                        from the environment.\n+\n+    :type http: :class:`httplib2.Http` or class that defines ``request()``.\n+    :param http: An optional HTTP object to make requests. If not passed, an\n+                 ``http`` object is created that is bound to the\n+                 ``credentials`` for the current object.\n+    \"\"\"\n+\n+    _connection_class = Connection\n+\n+    def sync_recognize(self, content, encoding, sample_rate,\n+                       language_code=None, max_alternatives=None,\n+                       profanity_filter=None,\n+                       speech_context=None):\n+        \"\"\"Synchronous Speech Recognition.\n+\n+        .. _sync_recognize: https://cloud.google.com/speech/reference/\\\n+                             rest/v1beta1/speech/syncrecognize\n+\n+        See `sync_recognize`_.\n+\n+        :type content: bytes\n+        :param content: Byte stream of audio.\n+\n+        :type encoding: str\n+        :param encoding: encoding of audio data sent in all RecognitionAudio\n+                         messages, can be one of: :attr:`~.Encoding.LINEAR16`,\n+                         :attr:`~.Encoding.FLAC`, :attr:`~.Encoding.MULAW`,\n+                         :attr:`~.Encoding.AMR`, :attr:`~.Encoding.AMR_WB`\n+\n+        :type sample_rate: int\n+        :param sample_rate: Sample rate in Hertz of the audio data sent in all\n+                           RecognitionAudio messages. Valid values are: 8000-\n+                           48000. 16000 is optimal. For best results, set the\n+                           sampling rate of the audio source to 16000 Hz.\n+                           If that's not possible, use the native sample rate\n+                           of the audio source (instead of re-sampling).\n+\n+        :type language_code: str\n+        :param language_code: (Optional) The language of the supplied audio as\n+                             BCP-47 language tag. Example: \"en-GB\".","path":"google/cloud/speech/client.py","position":95,"original_position":95,"commit_id":"c64e5ff1d3dfe9454b4f1950407e711dc9f6cdb8","original_commit_id":"c64e5ff1d3dfe9454b4f1950407e711dc9f6cdb8","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"Ditto here on the indent","created_at":"2016-09-19T16:25:48Z","updated_at":"2016-09-19T16:36:04Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344#discussion_r79430572","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments/79430572"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344#discussion_r79430572"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344","id":85708248,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2344","number":2344,"state":"open","locked":false,"title":"Basic implementation of Speech API.","user":{"login":"Fematich","id":4212658,"avatar_url":"https://avatars.githubusercontent.com/u/4212658?v=3","gravatar_id":"","url":"https://api.github.com/users/Fematich","html_url":"https://github.com/Fematich","followers_url":"https://api.github.com/users/Fematich/followers","following_url":"https://api.github.com/users/Fematich/following{/other_user}","gists_url":"https://api.github.com/users/Fematich/gists{/gist_id}","starred_url":"https://api.github.com/users/Fematich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fematich/subscriptions","organizations_url":"https://api.github.com/users/Fematich/orgs","repos_url":"https://api.github.com/users/Fematich/repos","events_url":"https://api.github.com/users/Fematich/events{/privacy}","received_events_url":"https://api.github.com/users/Fematich/received_events","type":"User","site_admin":false},"body":"I have made a basic implementation of Speech API.\r\nThis currently only supports `syncrecognize` from the REST-API.\r\n\r\nI think I followed all the contribution guidelines:\r\n- Documented in both the API and narrative documentation (in docs/).\r\n- Fully working on the following CPython versions: 2.7, 3.4, and 3.5 on both UNIX and Windows.\r\n- Feature added no new dependencies.\r\n\r\nHowever, this is my first contribution, so in case I missed something, please let me know and I will see how to fix it!","created_at":"2016-09-18T12:16:34Z","updated_at":"2016-09-19T16:36:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"258db022d8fe3c6d58d2bb3c7d6bb862a1e55d21","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2344/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/c64e5ff1d3dfe9454b4f1950407e711dc9f6cdb8","head":{"label":"Fematich:master","ref":"master","sha":"c64e5ff1d3dfe9454b4f1950407e711dc9f6cdb8","user":{"login":"Fematich","id":4212658,"avatar_url":"https://avatars.githubusercontent.com/u/4212658?v=3","gravatar_id":"","url":"https://api.github.com/users/Fematich","html_url":"https://github.com/Fematich","followers_url":"https://api.github.com/users/Fematich/followers","following_url":"https://api.github.com/users/Fematich/following{/other_user}","gists_url":"https://api.github.com/users/Fematich/gists{/gist_id}","starred_url":"https://api.github.com/users/Fematich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fematich/subscriptions","organizations_url":"https://api.github.com/users/Fematich/orgs","repos_url":"https://api.github.com/users/Fematich/repos","events_url":"https://api.github.com/users/Fematich/events{/privacy}","received_events_url":"https://api.github.com/users/Fematich/received_events","type":"User","site_admin":false},"repo":{"id":68452075,"name":"google-cloud-python","full_name":"Fematich/google-cloud-python","owner":{"login":"Fematich","id":4212658,"avatar_url":"https://avatars.githubusercontent.com/u/4212658?v=3","gravatar_id":"","url":"https://api.github.com/users/Fematich","html_url":"https://github.com/Fematich","followers_url":"https://api.github.com/users/Fematich/followers","following_url":"https://api.github.com/users/Fematich/following{/other_user}","gists_url":"https://api.github.com/users/Fematich/gists{/gist_id}","starred_url":"https://api.github.com/users/Fematich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fematich/subscriptions","organizations_url":"https://api.github.com/users/Fematich/orgs","repos_url":"https://api.github.com/users/Fematich/repos","events_url":"https://api.github.com/users/Fematich/events{/privacy}","received_events_url":"https://api.github.com/users/Fematich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fematich/google-cloud-python","description":"Google Cloud Client Library for Python","fork":true,"url":"https://api.github.com/repos/Fematich/google-cloud-python","forks_url":"https://api.github.com/repos/Fematich/google-cloud-python/forks","keys_url":"https://api.github.com/repos/Fematich/google-cloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fematich/google-cloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fematich/google-cloud-python/teams","hooks_url":"https://api.github.com/repos/Fematich/google-cloud-python/hooks","issue_events_url":"https://api.github.com/repos/Fematich/google-cloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/Fematich/google-cloud-python/events","assignees_url":"https://api.github.com/repos/Fematich/google-cloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/Fematich/google-cloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/Fematich/google-cloud-python/tags","blobs_url":"https://api.github.com/repos/Fematich/google-cloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fematich/google-cloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fematich/google-cloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fematich/google-cloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fematich/google-cloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Fematich/google-cloud-python/languages","stargazers_url":"https://api.github.com/repos/Fematich/google-cloud-python/stargazers","contributors_url":"https://api.github.com/repos/Fematich/google-cloud-python/contributors","subscribers_url":"https://api.github.com/repos/Fematich/google-cloud-python/subscribers","subscription_url":"https://api.github.com/repos/Fematich/google-cloud-python/subscription","commits_url":"https://api.github.com/repos/Fematich/google-cloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fematich/google-cloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fematich/google-cloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fematich/google-cloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fematich/google-cloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/Fematich/google-cloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fematich/google-cloud-python/merges","archive_url":"https://api.github.com/repos/Fematich/google-cloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fematich/google-cloud-python/downloads","issues_url":"https://api.github.com/repos/Fematich/google-cloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/Fematich/google-cloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Fematich/google-cloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Fematich/google-cloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fematich/google-cloud-python/labels{/name}","releases_url":"https://api.github.com/repos/Fematich/google-cloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/Fematich/google-cloud-python/deployments","created_at":"2016-09-17T12:55:30Z","updated_at":"2016-09-17T12:55:34Z","pushed_at":"2016-09-18T23:39:29Z","git_url":"git://github.com/Fematich/google-cloud-python.git","ssh_url":"git@github.com:Fematich/google-cloud-python.git","clone_url":"https://github.com/Fematich/google-cloud-python.git","svn_url":"https://github.com/Fematich/google-cloud-python","homepage":"https://googlecloudplatform.github.io/google-cloud-python/","size":81503,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"2ee65abd69cdcb1331f12ff29008dca689aaa02c","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":16316451,"name":"google-cloud-python","full_name":"GoogleCloudPlatform/google-cloud-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/deployments","created_at":"2014-01-28T15:51:47Z","updated_at":"2016-09-17T03:44:29Z","pushed_at":"2016-09-19T16:12:32Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-python","homepage":"https://googlecloudplatform.github.io/google-cloud-python/","size":84611,"stargazers_count":395,"watchers_count":395,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":202,"mirror_url":null,"open_issues_count":194,"forks":202,"open_issues":194,"watchers":395,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2344"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2344"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2344/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/pulls/2344/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/statuses/c64e5ff1d3dfe9454b4f1950407e711dc9f6cdb8"}}}}
{"actor":{"display_login":"dhermes"}}