Skip to content

Commit

Permalink
Merge pull request #3033 from dhermes/no-more-connection-modules
Browse files Browse the repository at this point in the history
Renaming all remaining connection.py modules as _http.py.
  • Loading branch information
dhermes authored Feb 17, 2017
2 parents 3aaa558 + e3ca2e0 commit af3074b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 38 deletions.
1 change: 0 additions & 1 deletion google-cloud-speech/google/cloud/speech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@

from google.cloud.speech.alternative import Alternative
from google.cloud.speech.client import Client
from google.cloud.speech.connection import Connection
from google.cloud.speech.encoding import Encoding
from google.cloud.speech.operation import Operation
18 changes: 18 additions & 0 deletions google-cloud-speech/google/cloud/speech/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,29 @@

from google.cloud._helpers import _bytes_to_unicode
from google.cloud._helpers import _to_bytes
from google.cloud import _http

from google.cloud.speech.result import Result
from google.cloud.speech.operation import Operation


class Connection(_http.JSONConnection):
"""A connection to Google Cloud Speech JSON REST API.
:type client: :class:`~google.cloud.speech.client.Client`
:param client: The client that owns the current connection.
"""

API_BASE_URL = 'https://speech.googleapis.com'
"""The base of the API call URL."""

API_VERSION = 'v1beta1'
"""The version of the API, used in building the API call's URL."""

API_URL_TEMPLATE = '{api_base_url}/{api_version}/{path}'
"""A template for the URL of a particular API call."""


class HTTPSpeechAPI(object):
"""Speech API for interacting with the HTTP version of the API.
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-speech/google/cloud/speech/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from google.cloud.environment_vars import DISABLE_GRPC

from google.cloud.speech._gax import GAPICSpeechAPI
from google.cloud.speech._http import Connection
from google.cloud.speech._http import HTTPSpeechAPI
from google.cloud.speech.connection import Connection
from google.cloud.speech.sample import Sample


Expand Down
34 changes: 0 additions & 34 deletions google-cloud-speech/google/cloud/speech/connection.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestConnection(unittest.TestCase):

@staticmethod
def _get_target_class():
from google.cloud.speech.connection import Connection
from google.cloud.speech._http import Connection

return Connection

Expand Down
2 changes: 1 addition & 1 deletion google-cloud-speech/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _make_one(self, *args, **kw):
return self._get_target_class()(*args, **kw)

def test_ctor(self):
from google.cloud.speech.connection import Connection
from google.cloud.speech._http import Connection

creds = _make_credentials()
http = object()
Expand Down

0 comments on commit af3074b

Please sign in to comment.