diff --git a/bigquery/google/cloud/bigquery/__init__.py b/bigquery/google/cloud/bigquery/__init__.py index fec0eee614cb..cde9432d83e2 100644 --- a/bigquery/google/cloud/bigquery/__init__.py +++ b/bigquery/google/cloud/bigquery/__init__.py @@ -24,11 +24,7 @@ from google.cloud.bigquery.client import Client -from google.cloud.bigquery.connection import Connection from google.cloud.bigquery.dataset import AccessGrant from google.cloud.bigquery.dataset import Dataset from google.cloud.bigquery.schema import SchemaField from google.cloud.bigquery.table import Table - - -SCOPE = Connection.SCOPE diff --git a/bigquery/google/cloud/bigquery/connection.py b/bigquery/google/cloud/bigquery/_http.py similarity index 100% rename from bigquery/google/cloud/bigquery/connection.py rename to bigquery/google/cloud/bigquery/_http.py diff --git a/bigquery/google/cloud/bigquery/client.py b/bigquery/google/cloud/bigquery/client.py index 785cc842e56f..d16a9d9349d2 100644 --- a/bigquery/google/cloud/bigquery/client.py +++ b/bigquery/google/cloud/bigquery/client.py @@ -16,7 +16,7 @@ from google.cloud.client import JSONClient -from google.cloud.bigquery.connection import Connection +from google.cloud.bigquery._http import Connection from google.cloud.bigquery.dataset import Dataset from google.cloud.bigquery.job import CopyJob from google.cloud.bigquery.job import ExtractTableToStorageJob diff --git a/bigquery/unit_tests/test_connection.py b/bigquery/unit_tests/test__http.py similarity index 96% rename from bigquery/unit_tests/test_connection.py rename to bigquery/unit_tests/test__http.py index 35ec0276e86b..a2564ee278b8 100644 --- a/bigquery/unit_tests/test_connection.py +++ b/bigquery/unit_tests/test__http.py @@ -18,7 +18,7 @@ class TestConnection(unittest.TestCase): def _getTargetClass(self): - from google.cloud.bigquery.connection import Connection + from google.cloud.bigquery._http import Connection return Connection def _makeOne(self, *args, **kw): diff --git a/bigquery/unit_tests/test_client.py b/bigquery/unit_tests/test_client.py index e2f0618a10da..cd2198078f74 100644 --- a/bigquery/unit_tests/test_client.py +++ b/bigquery/unit_tests/test_client.py @@ -25,7 +25,7 @@ def _makeOne(self, *args, **kw): return self._getTargetClass()(*args, **kw) def test_ctor(self): - from google.cloud.bigquery.connection import Connection + from google.cloud.bigquery._http import Connection PROJECT = 'PROJECT' creds = _Credentials() http = object() diff --git a/datastore/google/cloud/datastore/__init__.py b/datastore/google/cloud/datastore/__init__.py index 9a97e81759e2..7ca8e3f116f0 100644 --- a/datastore/google/cloud/datastore/__init__.py +++ b/datastore/google/cloud/datastore/__init__.py @@ -27,10 +27,6 @@ The main concepts with this API are: -- :class:`~google.cloud.datastore.connection.Connection` - which represents a connection between your machine and the Cloud Datastore - API. - - :class:`~google.cloud.datastore.client.Client` which represents a project (string) and namespace (string) bundled with a connection and has convenience methods for constructing objects with that @@ -54,12 +50,8 @@ from google.cloud.datastore.batch import Batch -from google.cloud.datastore.connection import Connection from google.cloud.datastore.client import Client from google.cloud.datastore.entity import Entity from google.cloud.datastore.key import Key from google.cloud.datastore.query import Query from google.cloud.datastore.transaction import Transaction - - -SCOPE = Connection.SCOPE diff --git a/datastore/google/cloud/datastore/connection.py b/datastore/google/cloud/datastore/_http.py similarity index 99% rename from datastore/google/cloud/datastore/connection.py rename to datastore/google/cloud/datastore/_http.py index 67a542d85405..4636b2651b7a 100644 --- a/datastore/google/cloud/datastore/connection.py +++ b/datastore/google/cloud/datastore/_http.py @@ -71,7 +71,7 @@ class _DatastoreAPIOverHttp(object): Methods make bare API requests without any helpers for constructing the requests or parsing the responses. - :type connection: :class:`google.cloud.datastore.connection.Connection` + :type connection: :class:`Connection` :param connection: A connection object that contains helpful information for making requests. """ @@ -268,7 +268,7 @@ class _DatastoreAPIOverGRPC(object): Methods make bare API requests without any helpers for constructing the requests or parsing the responses. - :type connection: :class:`google.cloud.datastore.connection.Connection` + :type connection: :class:`Connection` :param connection: A connection object that contains helpful information for making requests. diff --git a/datastore/google/cloud/datastore/batch.py b/datastore/google/cloud/datastore/batch.py index f27d67255525..e944b56b7a6e 100644 --- a/datastore/google/cloud/datastore/batch.py +++ b/datastore/google/cloud/datastore/batch.py @@ -107,7 +107,7 @@ def namespace(self): def connection(self): """Getter for connection over which the batch will run. - :rtype: :class:`google.cloud.datastore.connection.Connection` + :rtype: :class:`google.cloud.datastore._http.Connection` :returns: The connection over which the batch will run. """ return self._client.connection diff --git a/datastore/google/cloud/datastore/client.py b/datastore/google/cloud/datastore/client.py index b97d45437682..4b4a53f70d83 100644 --- a/datastore/google/cloud/datastore/client.py +++ b/datastore/google/cloud/datastore/client.py @@ -20,8 +20,8 @@ _determine_default_project as _base_default_project) from google.cloud.client import _ClientProjectMixin from google.cloud.client import Client as _BaseClient +from google.cloud.datastore._http import Connection from google.cloud.datastore import helpers -from google.cloud.datastore.connection import Connection from google.cloud.datastore.batch import Batch from google.cloud.datastore.entity import Entity from google.cloud.datastore.key import Key @@ -72,7 +72,7 @@ def _extended_lookup(connection, project, key_pbs, Helper function for :meth:`Client.get_multi`. - :type connection: :class:`google.cloud.datastore.connection.Connection` + :type connection: :class:`google.cloud.datastore._http.Connection` :param connection: The connection used to connect to datastore. :type project: str diff --git a/datastore/unit_tests/test_connection.py b/datastore/unit_tests/test__http.py similarity index 97% rename from datastore/unit_tests/test_connection.py rename to datastore/unit_tests/test__http.py index 973a3241506e..c7f35c3b4772 100644 --- a/datastore/unit_tests/test_connection.py +++ b/datastore/unit_tests/test__http.py @@ -14,13 +14,13 @@ import unittest -from google.cloud.datastore.connection import _HAVE_GRPC +from google.cloud.datastore._http import _HAVE_GRPC class Test_DatastoreAPIOverHttp(unittest.TestCase): def _getTargetClass(self): - from google.cloud.datastore.connection import _DatastoreAPIOverHttp + from google.cloud.datastore._http import _DatastoreAPIOverHttp return _DatastoreAPIOverHttp def _makeOne(self, *args, **kw): @@ -110,7 +110,7 @@ def test__request_not_200(self): class Test__grpc_catch_rendezvous(unittest.TestCase): def _callFUT(self): - from google.cloud.datastore.connection import _grpc_catch_rendezvous + from google.cloud.datastore._http import _grpc_catch_rendezvous return _grpc_catch_rendezvous() @staticmethod @@ -175,12 +175,12 @@ def test_commit_failure_non_grpc_err(self): class Test_DatastoreAPIOverGRPC(unittest.TestCase): def _getTargetClass(self): - from google.cloud.datastore.connection import _DatastoreAPIOverGRPC + from google.cloud.datastore._http import _DatastoreAPIOverGRPC return _DatastoreAPIOverGRPC def _makeOne(self, stub, connection=None, secure=True, mock_args=None): from google.cloud._testing import _Monkey - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT if connection is None: connection = _Connection(None) @@ -202,7 +202,7 @@ def mock_make_stub(*args): return self._getTargetClass()(connection, secure) def test_constructor(self): - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT conn = _Connection(None) conn.credentials = object() @@ -222,7 +222,7 @@ def test_constructor(self): )]) def test_constructor_insecure(self): - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT conn = _Connection(None) conn.credentials = object() @@ -351,7 +351,7 @@ def test_allocate_ids(self): class TestConnection(unittest.TestCase): def _getTargetClass(self): - from google.cloud.datastore.connection import Connection + from google.cloud.datastore._http import Connection return Connection @@ -370,7 +370,7 @@ def _make_query_pb(self, kind): def _makeOne(self, credentials=None, http=None, use_grpc=False): from google.cloud._testing import _Monkey - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT with _Monkey(MUT, _USE_GRPC=use_grpc): return self._getTargetClass()(credentials=credentials, http=http) @@ -408,7 +408,7 @@ def test_ctor_defaults(self): def test_ctor_without_grpc(self): from google.cloud._testing import _Monkey - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT connections = [] return_val = object() @@ -426,7 +426,7 @@ def mock_api(connection): def test_ctor_with_grpc(self): from google.cloud._testing import _Monkey - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT api_args = [] return_val = object() @@ -921,7 +921,7 @@ def test_begin_transaction(self): def test_commit_wo_transaction(self): from google.cloud._testing import _Monkey from google.cloud.datastore._generated import datastore_pb2 - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT from google.cloud.datastore.helpers import _new_value_pb PROJECT = 'PROJECT' @@ -967,7 +967,7 @@ def mock_parse(response): def test_commit_w_transaction(self): from google.cloud._testing import _Monkey from google.cloud.datastore._generated import datastore_pb2 - from google.cloud.datastore import connection as MUT + from google.cloud.datastore import _http as MUT from google.cloud.datastore.helpers import _new_value_pb PROJECT = 'PROJECT' @@ -1091,7 +1091,7 @@ def test_allocate_ids_non_empty(self): class Test__parse_commit_response(unittest.TestCase): def _callFUT(self, commit_response_pb): - from google.cloud.datastore.connection import _parse_commit_response + from google.cloud.datastore._http import _parse_commit_response return _parse_commit_response(commit_response_pb) def test_it(self): diff --git a/docs/bigquery-client.rst b/docs/bigquery-client.rst index a1c41f689ce4..2c7b2c8d21ff 100644 --- a/docs/bigquery-client.rst +++ b/docs/bigquery-client.rst @@ -4,10 +4,3 @@ BigQuery Client .. automodule:: google.cloud.bigquery.client :members: :show-inheritance: - -Connection -~~~~~~~~~~ - -.. automodule:: google.cloud.bigquery.connection - :members: - :show-inheritance: diff --git a/docs/datastore-client.rst b/docs/datastore-client.rst index 924fa5d789a5..060477ec12fd 100644 --- a/docs/datastore-client.rst +++ b/docs/datastore-client.rst @@ -4,10 +4,3 @@ Datastore Client .. automodule:: google.cloud.datastore.client :members: :show-inheritance: - -Connection -~~~~~~~~~~ - -.. automodule:: google.cloud.datastore.connection - :members: - :show-inheritance: diff --git a/docs/logging-client.rst b/docs/logging-client.rst index cc834d1c21af..f04d5c5255f1 100644 --- a/docs/logging-client.rst +++ b/docs/logging-client.rst @@ -4,10 +4,3 @@ Stackdriver Logging Client .. automodule:: google.cloud.logging.client :members: :show-inheritance: - -Connection -~~~~~~~~~~ - -.. automodule:: google.cloud.logging.connection - :members: - :show-inheritance: diff --git a/docs/pubsub-client.rst b/docs/pubsub-client.rst index c5e70e6ae683..2745c1d808ee 100644 --- a/docs/pubsub-client.rst +++ b/docs/pubsub-client.rst @@ -4,10 +4,3 @@ Pub/Sub Client .. automodule:: google.cloud.pubsub.client :members: :show-inheritance: - -Connection -~~~~~~~~~~ - -.. automodule:: google.cloud.pubsub.connection - :members: - :show-inheritance: diff --git a/docs/storage-client.rst b/docs/storage-client.rst index 9c73e60c0e3e..1358bbfe664c 100644 --- a/docs/storage-client.rst +++ b/docs/storage-client.rst @@ -4,10 +4,3 @@ Storage Client .. automodule:: google.cloud.storage.client :members: :show-inheritance: - -Connection -~~~~~~~~~~ - -.. automodule:: google.cloud.storage.connection - :members: - :show-inheritance: diff --git a/logging/google/cloud/logging/__init__.py b/logging/google/cloud/logging/__init__.py index ea29393f6292..d83ea4798949 100644 --- a/logging/google/cloud/logging/__init__.py +++ b/logging/google/cloud/logging/__init__.py @@ -16,10 +16,8 @@ from google.cloud.logging.client import Client -from google.cloud.logging.connection import Connection -SCOPE = Connection.SCOPE ASCENDING = 'timestamp asc' """Query string to order by ascending timestamps.""" DESCENDING = 'timestamp desc' diff --git a/logging/google/cloud/logging/connection.py b/logging/google/cloud/logging/_http.py similarity index 100% rename from logging/google/cloud/logging/connection.py rename to logging/google/cloud/logging/_http.py diff --git a/logging/google/cloud/logging/client.py b/logging/google/cloud/logging/client.py index 801d4ec63dc8..b84fc9c6a736 100644 --- a/logging/google/cloud/logging/client.py +++ b/logging/google/cloud/logging/client.py @@ -30,10 +30,10 @@ from google.cloud.client import JSONClient from google.cloud.environment_vars import DISABLE_GRPC -from google.cloud.logging.connection import Connection -from google.cloud.logging.connection import _LoggingAPI as JSONLoggingAPI -from google.cloud.logging.connection import _MetricsAPI as JSONMetricsAPI -from google.cloud.logging.connection import _SinksAPI as JSONSinksAPI +from google.cloud.logging._http import Connection +from google.cloud.logging._http import _LoggingAPI as JSONLoggingAPI +from google.cloud.logging._http import _MetricsAPI as JSONMetricsAPI +from google.cloud.logging._http import _SinksAPI as JSONSinksAPI from google.cloud.logging.logger import Logger from google.cloud.logging.metric import Metric from google.cloud.logging.sink import Sink diff --git a/logging/unit_tests/test_connection.py b/logging/unit_tests/test__http.py similarity index 99% rename from logging/unit_tests/test_connection.py rename to logging/unit_tests/test__http.py index 5d41877476d8..942450063487 100644 --- a/logging/unit_tests/test_connection.py +++ b/logging/unit_tests/test__http.py @@ -21,7 +21,7 @@ class TestConnection(unittest.TestCase): FILTER = 'logName:syslog AND severity>=ERROR' def _getTargetClass(self): - from google.cloud.logging.connection import Connection + from google.cloud.logging._http import Connection return Connection def _makeOne(self, *args, **kw): @@ -43,7 +43,7 @@ class Test_LoggingAPI(unittest.TestCase): FILTER = 'logName:syslog AND severity>=ERROR' def _getTargetClass(self): - from google.cloud.logging.connection import _LoggingAPI + from google.cloud.logging._http import _LoggingAPI return _LoggingAPI def _makeOne(self, *args, **kw): @@ -292,7 +292,7 @@ class Test_SinksAPI(unittest.TestCase): DESTINATION_URI = 'faux.googleapis.com/destination' def _getTargetClass(self): - from google.cloud.logging.connection import _SinksAPI + from google.cloud.logging._http import _SinksAPI return _SinksAPI def _makeOne(self, *args, **kw): @@ -533,7 +533,7 @@ class Test_MetricsAPI(unittest.TestCase): DESCRIPTION = 'DESCRIPTION' def _getTargetClass(self): - from google.cloud.logging.connection import _MetricsAPI + from google.cloud.logging._http import _MetricsAPI return _MetricsAPI def _makeOne(self, *args, **kw): diff --git a/logging/unit_tests/test_client.py b/logging/unit_tests/test_client.py index 1b8daa10f9fb..b498c13df656 100644 --- a/logging/unit_tests/test_client.py +++ b/logging/unit_tests/test_client.py @@ -39,7 +39,7 @@ def test_ctor(self): self.assertEqual(client.project, self.PROJECT) def test_logging_api_wo_gax(self): - from google.cloud.logging.connection import _LoggingAPI + from google.cloud.logging._http import _LoggingAPI client = self._makeOne(self.PROJECT, credentials=_Credentials(), use_gax=False) @@ -79,7 +79,7 @@ def make_api(client_obj): def test_no_gax_ctor(self): from google.cloud._testing import _Monkey from google.cloud.logging import client as MUT - from google.cloud.logging.connection import _LoggingAPI + from google.cloud.logging._http import _LoggingAPI creds = _Credentials() with _Monkey(MUT, _USE_GAX=True): @@ -90,7 +90,7 @@ def test_no_gax_ctor(self): self.assertIsInstance(api, _LoggingAPI) def test_sinks_api_wo_gax(self): - from google.cloud.logging.connection import _SinksAPI + from google.cloud.logging._http import _SinksAPI from google.cloud.logging import client as MUT from google.cloud._testing import _Monkey @@ -131,7 +131,7 @@ def make_api(client_obj): self.assertIs(again, api) def test_metrics_api_wo_gax(self): - from google.cloud.logging.connection import _MetricsAPI + from google.cloud.logging._http import _MetricsAPI from google.cloud.logging import client as MUT from google.cloud._testing import _Monkey diff --git a/pubsub/google/cloud/pubsub/__init__.py b/pubsub/google/cloud/pubsub/__init__.py index d072d315ed98..9c0fcb9d45f6 100644 --- a/pubsub/google/cloud/pubsub/__init__.py +++ b/pubsub/google/cloud/pubsub/__init__.py @@ -25,9 +25,5 @@ from google.cloud.pubsub.client import Client -from google.cloud.pubsub.connection import Connection from google.cloud.pubsub.subscription import Subscription from google.cloud.pubsub.topic import Topic - - -SCOPE = Connection.SCOPE diff --git a/pubsub/google/cloud/pubsub/_gax.py b/pubsub/google/cloud/pubsub/_gax.py index ecfba42477f4..2636dbea2c89 100644 --- a/pubsub/google/cloud/pubsub/_gax.py +++ b/pubsub/google/cloud/pubsub/_gax.py @@ -512,7 +512,7 @@ def make_gax_publisher_api(connection): an insecure ``channel`` is created pointing at the local Pub / Sub server. - :type connection: :class:`~google.cloud.pubsub.connection.Connection` + :type connection: :class:`~google.cloud.pubsub._http.Connection` :param connection: The connection that holds configuration details. :rtype: :class:`~google.cloud.pubsub.v1.publisher_api.PublisherApi` @@ -536,7 +536,7 @@ def make_gax_subscriber_api(connection): an insecure ``channel`` is created pointing at the local Pub / Sub server. - :type connection: :class:`~google.cloud.pubsub.connection.Connection` + :type connection: :class:`~google.cloud.pubsub._http.Connection` :param connection: The connection that holds configuration details. :rtype: :class:`~google.cloud.pubsub.v1.subscriber_api.SubscriberApi` diff --git a/pubsub/google/cloud/pubsub/connection.py b/pubsub/google/cloud/pubsub/_http.py similarity index 100% rename from pubsub/google/cloud/pubsub/connection.py rename to pubsub/google/cloud/pubsub/_http.py diff --git a/pubsub/google/cloud/pubsub/client.py b/pubsub/google/cloud/pubsub/client.py index ec909fda4f2e..c357a5f8753d 100644 --- a/pubsub/google/cloud/pubsub/client.py +++ b/pubsub/google/cloud/pubsub/client.py @@ -18,10 +18,10 @@ from google.cloud.client import JSONClient from google.cloud.environment_vars import DISABLE_GRPC -from google.cloud.pubsub.connection import Connection -from google.cloud.pubsub.connection import _PublisherAPI as JSONPublisherAPI -from google.cloud.pubsub.connection import _SubscriberAPI as JSONSubscriberAPI -from google.cloud.pubsub.connection import _IAMPolicyAPI +from google.cloud.pubsub._http import Connection +from google.cloud.pubsub._http import _PublisherAPI as JSONPublisherAPI +from google.cloud.pubsub._http import _SubscriberAPI as JSONSubscriberAPI +from google.cloud.pubsub._http import _IAMPolicyAPI from google.cloud.pubsub.topic import Topic try: diff --git a/pubsub/unit_tests/test_connection.py b/pubsub/unit_tests/test__http.py similarity index 99% rename from pubsub/unit_tests/test_connection.py rename to pubsub/unit_tests/test__http.py index 3d6f39b27113..ce6abe4553ae 100644 --- a/pubsub/unit_tests/test_connection.py +++ b/pubsub/unit_tests/test__http.py @@ -32,7 +32,7 @@ def _makeOne(self, *args, **kw): class TestConnection(_Base): def _getTargetClass(self): - from google.cloud.pubsub.connection import Connection + from google.cloud.pubsub._http import Connection return Connection def test_default_url(self): @@ -93,7 +93,7 @@ def test_build_api_url_w_base_url_override(self): class Test_PublisherAPI(_Base): def _getTargetClass(self): - from google.cloud.pubsub.connection import _PublisherAPI + from google.cloud.pubsub._http import _PublisherAPI return _PublisherAPI def _makeOne(self, *args, **kw): @@ -409,7 +409,7 @@ def test_topic_list_subscriptions_miss(self): class Test_SubscriberAPI(_Base): def _getTargetClass(self): - from google.cloud.pubsub.connection import _SubscriberAPI + from google.cloud.pubsub._http import _SubscriberAPI return _SubscriberAPI def _makeOne(self, *args, **kw): @@ -711,7 +711,7 @@ def test_subscription_modify_ack_deadline(self): class Test_IAMPolicyAPI(_Base): def _getTargetClass(self): - from google.cloud.pubsub.connection import _IAMPolicyAPI + from google.cloud.pubsub._http import _IAMPolicyAPI return _IAMPolicyAPI def test_ctor(self): @@ -824,7 +824,7 @@ def test_test_iam_permissions_missing_key(self): class Test__transform_messages_base64_empty(unittest.TestCase): def _callFUT(self, messages, transform, key=None): - from google.cloud.pubsub.connection import _transform_messages_base64 + from google.cloud.pubsub._http import _transform_messages_base64 return _transform_messages_base64(messages, transform, key) def test__transform_messages_base64_empty_message(self): diff --git a/pubsub/unit_tests/test_client.py b/pubsub/unit_tests/test_client.py index 08ed1f29f2fc..2f2dbfec02c5 100644 --- a/pubsub/unit_tests/test_client.py +++ b/pubsub/unit_tests/test_client.py @@ -30,7 +30,7 @@ def _makeOne(self, *args, **kw): return self._getTargetClass()(*args, **kw) def test_publisher_api_wo_gax(self): - from google.cloud.pubsub.connection import _PublisherAPI + from google.cloud.pubsub._http import _PublisherAPI from google.cloud.pubsub import client as MUT from google.cloud._testing import _Monkey creds = _Credentials() @@ -49,7 +49,7 @@ def test_publisher_api_wo_gax(self): def test_no_gax_ctor(self): from google.cloud._testing import _Monkey - from google.cloud.pubsub.connection import _PublisherAPI + from google.cloud.pubsub._http import _PublisherAPI from google.cloud.pubsub import client as MUT creds = _Credentials() @@ -96,7 +96,7 @@ def __init__(self, _wrapped, client): self.assertEqual(_called_with, [(args, {})]) def test_subscriber_api_wo_gax(self): - from google.cloud.pubsub.connection import _SubscriberAPI + from google.cloud.pubsub._http import _SubscriberAPI from google.cloud.pubsub import client as MUT from google.cloud._testing import _Monkey creds = _Credentials() @@ -148,7 +148,7 @@ def __init__(self, _wrapped, client): self.assertEqual(_called_with, [(args, {})]) def test_iam_policy_api(self): - from google.cloud.pubsub.connection import _IAMPolicyAPI + from google.cloud.pubsub._http import _IAMPolicyAPI creds = _Credentials() client = self._makeOne(project=self.PROJECT, credentials=creds) conn = client.connection = object() diff --git a/storage/google/cloud/storage/__init__.py b/storage/google/cloud/storage/__init__.py index 3c26fa57e382..c7ad7c8ecf32 100644 --- a/storage/google/cloud/storage/__init__.py +++ b/storage/google/cloud/storage/__init__.py @@ -28,13 +28,10 @@ The main concepts with this API are: -- :class:`google.cloud.storage.connection.Connection` which represents a - connection between your machine and the Cloud Storage API. - -- :class:`google.cloud.storage.bucket.Bucket` which represents a particular +- :class:`~google.cloud.storage.bucket.Bucket` which represents a particular bucket (akin to a mounted disk on a computer). -- :class:`google.cloud.storage.blob.Blob` which represents a pointer to a +- :class:`~google.cloud.storage.blob.Blob` which represents a pointer to a particular entity in Cloud Storage (akin to a file path on a remote machine). """ @@ -43,7 +40,3 @@ from google.cloud.storage.blob import Blob from google.cloud.storage.bucket import Bucket from google.cloud.storage.client import Client -from google.cloud.storage.connection import Connection - - -SCOPE = Connection.SCOPE diff --git a/storage/google/cloud/storage/connection.py b/storage/google/cloud/storage/_http.py similarity index 100% rename from storage/google/cloud/storage/connection.py rename to storage/google/cloud/storage/_http.py diff --git a/storage/google/cloud/storage/batch.py b/storage/google/cloud/storage/batch.py index c07dce0e023e..96384f9ed9aa 100644 --- a/storage/google/cloud/storage/batch.py +++ b/storage/google/cloud/storage/batch.py @@ -27,7 +27,7 @@ import six from google.cloud.exceptions import make_exception -from google.cloud.storage.connection import Connection +from google.cloud.storage._http import Connection class MIMEApplicationHTTP(MIMEApplication): diff --git a/storage/google/cloud/storage/client.py b/storage/google/cloud/storage/client.py index d7fa82d8e7de..c1711a9bbdf3 100644 --- a/storage/google/cloud/storage/client.py +++ b/storage/google/cloud/storage/client.py @@ -19,9 +19,9 @@ from google.cloud.client import JSONClient from google.cloud.exceptions import NotFound from google.cloud.iterator import HTTPIterator +from google.cloud.storage._http import Connection from google.cloud.storage.batch import Batch from google.cloud.storage.bucket import Bucket -from google.cloud.storage.connection import Connection class Client(JSONClient): @@ -57,7 +57,7 @@ def __init__(self, project=None, credentials=None, http=None): def connection(self): """Get connection or batch on the client. - :rtype: :class:`google.cloud.storage.connection.Connection` + :rtype: :class:`google.cloud.storage._http.Connection` :returns: The connection set on the client, or the batch if one is set. """ @@ -74,7 +74,7 @@ def connection(self, value): self.connection = connection Will raise if the connection is set more than once. - :type value: :class:`google.cloud.storage.connection.Connection` + :type value: :class:`google.cloud.storage._http.Connection` :param value: The connection set on the client. :raises: :class:`ValueError` if connection has already been set. diff --git a/storage/unit_tests/test_connection.py b/storage/unit_tests/test__http.py similarity index 96% rename from storage/unit_tests/test_connection.py rename to storage/unit_tests/test__http.py index 4b995e673e12..e2034a6758f9 100644 --- a/storage/unit_tests/test_connection.py +++ b/storage/unit_tests/test__http.py @@ -18,7 +18,7 @@ class TestConnection(unittest.TestCase): def _getTargetClass(self): - from google.cloud.storage.connection import Connection + from google.cloud.storage._http import Connection return Connection def _makeOne(self, *args, **kw): diff --git a/storage/unit_tests/test_client.py b/storage/unit_tests/test_client.py index 61eeda051db5..6807771e5628 100644 --- a/storage/unit_tests/test_client.py +++ b/storage/unit_tests/test_client.py @@ -25,7 +25,7 @@ def _makeOne(self, *args, **kw): return self._getTargetClass()(*args, **kw) def test_ctor_connection_type(self): - from google.cloud.storage.connection import Connection + from google.cloud.storage._http import Connection PROJECT = 'PROJECT' CREDENTIALS = _Credentials()