Skip to content

Commit af3074b

Browse files
authored
Merge pull request #3033 from dhermes/no-more-connection-modules
Renaming all remaining connection.py modules as _http.py.
2 parents 3aaa558 + e3ca2e0 commit af3074b

File tree

6 files changed

+21
-38
lines changed

6 files changed

+21
-38
lines changed

google-cloud-speech/google/cloud/speech/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616

1717
from google.cloud.speech.alternative import Alternative
1818
from google.cloud.speech.client import Client
19-
from google.cloud.speech.connection import Connection
2019
from google.cloud.speech.encoding import Encoding
2120
from google.cloud.speech.operation import Operation

google-cloud-speech/google/cloud/speech/_http.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,29 @@
1818

1919
from google.cloud._helpers import _bytes_to_unicode
2020
from google.cloud._helpers import _to_bytes
21+
from google.cloud import _http
2122

2223
from google.cloud.speech.result import Result
2324
from google.cloud.speech.operation import Operation
2425

2526

27+
class Connection(_http.JSONConnection):
28+
"""A connection to Google Cloud Speech JSON REST API.
29+
30+
:type client: :class:`~google.cloud.speech.client.Client`
31+
:param client: The client that owns the current connection.
32+
"""
33+
34+
API_BASE_URL = 'https://speech.googleapis.com'
35+
"""The base of the API call URL."""
36+
37+
API_VERSION = 'v1beta1'
38+
"""The version of the API, used in building the API call's URL."""
39+
40+
API_URL_TEMPLATE = '{api_base_url}/{api_version}/{path}'
41+
"""A template for the URL of a particular API call."""
42+
43+
2644
class HTTPSpeechAPI(object):
2745
"""Speech API for interacting with the HTTP version of the API.
2846

google-cloud-speech/google/cloud/speech/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
from google.cloud.environment_vars import DISABLE_GRPC
2121

2222
from google.cloud.speech._gax import GAPICSpeechAPI
23+
from google.cloud.speech._http import Connection
2324
from google.cloud.speech._http import HTTPSpeechAPI
24-
from google.cloud.speech.connection import Connection
2525
from google.cloud.speech.sample import Sample
2626

2727

google-cloud-speech/google/cloud/speech/connection.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

google-cloud-speech/unit_tests/test_connection.py renamed to google-cloud-speech/unit_tests/test__http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TestConnection(unittest.TestCase):
1919

2020
@staticmethod
2121
def _get_target_class():
22-
from google.cloud.speech.connection import Connection
22+
from google.cloud.speech._http import Connection
2323

2424
return Connection
2525

google-cloud-speech/unit_tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _make_one(self, *args, **kw):
8585
return self._get_target_class()(*args, **kw)
8686

8787
def test_ctor(self):
88-
from google.cloud.speech.connection import Connection
88+
from google.cloud.speech._http import Connection
8989

9090
creds = _make_credentials()
9191
http = object()

0 commit comments

Comments
 (0)