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 3455b03 + 1adc08e commit c517b44
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 38 deletions.
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 packages/google-cloud-python-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
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

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
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 c517b44

Please sign in to comment.