File tree Expand file tree Collapse file tree 11 files changed +22
-25
lines changed
bigquery/google/cloud/bigquery
logging/google/cloud/logging
monitoring/google/cloud/monitoring
pubsub/google/cloud/pubsub
runtimeconfig/google/cloud/runtimeconfig
storage/google/cloud/storage
vision/google/cloud/vision Expand file tree Collapse file tree 11 files changed +22
-25
lines changed Original file line number Diff line number Diff line change 1515"""Client for interacting with the Google BigQuery API."""
1616
1717
18- from google .cloud .client import JSONClient
18+ from google .cloud .client import ClientWithProject
1919from google .cloud .bigquery ._http import Connection
2020from google .cloud .bigquery .dataset import Dataset
2121from google .cloud .bigquery .job import CopyJob
@@ -50,7 +50,7 @@ def from_api_repr(cls, resource):
5050 resource ['id' ], resource ['numericId' ], resource ['friendlyName' ])
5151
5252
53- class Client (JSONClient ):
53+ class Client (ClientWithProject ):
5454 """Client to bundle configuration needed for API requests.
5555
5656 :type project: str
Original file line number Diff line number Diff line change @@ -129,11 +129,8 @@ def _determine_default(project):
129129 return _determine_default_project (project )
130130
131131
132- class JSONClient (Client , _ClientProjectMixin ):
133- """Client for Google JSON-based API.
134-
135- Assumes such APIs use the ``project`` and the client needs to store this
136- value.
132+ class ClientWithProject (Client , _ClientProjectMixin ):
133+ """Client that also stores a project.
137134
138135 :type project: str
139136 :param project: the project which the client acts on behalf of. If not
Original file line number Diff line number Diff line change @@ -789,7 +789,7 @@ def mock_channel(*args, **kwargs):
789789 credentials = object ()
790790 user_agent = 'you-sir-age-int'
791791 host = 'localhost'
792- extra_options = {'extra_options' : None }
792+ extra_options = {'extra_options' : () }
793793 with _Monkey (MUT , make_secure_channel = mock_channel ):
794794 stub = self ._call_fut (credentials , user_agent ,
795795 stub_class , host )
Original file line number Diff line number Diff line change @@ -104,13 +104,13 @@ def test_from_service_account_json_bad_args(self):
104104 mock .sentinel .filename , credentials = mock .sentinel .credentials )
105105
106106
107- class TestJSONClient (unittest .TestCase ):
107+ class TestClientWithProject (unittest .TestCase ):
108108
109109 @staticmethod
110110 def _get_target_class ():
111- from google .cloud .client import JSONClient
111+ from google .cloud .client import ClientWithProject
112112
113- return JSONClient
113+ return ClientWithProject
114114
115115 def _make_one (self , * args , ** kw ):
116116 return self ._get_target_class ()(* args , ** kw )
Original file line number Diff line number Diff line change 1515"""Client for interacting with the Google Cloud DNS API."""
1616
1717
18- from google .cloud .client import JSONClient
18+ from google .cloud .client import ClientWithProject
1919from google .cloud .dns .connection import Connection
2020from google .cloud .dns .zone import ManagedZone
2121from google .cloud .iterator import HTTPIterator
2222
2323
24- class Client (JSONClient ):
24+ class Client (ClientWithProject ):
2525 """Client to bundle configuration needed for API requests.
2626
2727 :type project: str
Original file line number Diff line number Diff line change 2929else :
3030 _HAVE_GAX = True
3131
32- from google .cloud .client import JSONClient
32+ from google .cloud .client import ClientWithProject
3333from google .cloud .environment_vars import DISABLE_GRPC
3434from google .cloud .logging ._http import Connection
3535from google .cloud .logging ._http import _LoggingAPI as JSONLoggingAPI
5959"""Environment variable set in a Google Container Engine environment."""
6060
6161
62- class Client (JSONClient ):
62+ class Client (ClientWithProject ):
6363 """Client to bundle configuration needed for API requests.
6464
6565 :type project: str
Original file line number Diff line number Diff line change 3131import datetime
3232
3333from google .cloud ._helpers import _datetime_to_rfc3339
34- from google .cloud .client import JSONClient
34+ from google .cloud .client import ClientWithProject
3535from google .cloud .monitoring .connection import Connection
3636from google .cloud .monitoring .group import Group
3737from google .cloud .monitoring .metric import Metric
4747_UTCNOW = datetime .datetime .utcnow # To be replaced by tests.
4848
4949
50- class Client (JSONClient ):
50+ class Client (ClientWithProject ):
5151 """Client to bundle configuration needed for API requests.
5252
5353 :type project: str
Original file line number Diff line number Diff line change 1616
1717import os
1818
19- from google .cloud .client import JSONClient
19+ from google .cloud .client import ClientWithProject
2020from google .cloud .environment_vars import DISABLE_GRPC
2121from google .cloud .pubsub ._http import Connection
2222from google .cloud .pubsub ._http import _PublisherAPI as JSONPublisherAPI
4343_USE_GAX = _HAVE_GAX and not _DISABLE_GAX
4444
4545
46- class Client (JSONClient ):
46+ class Client (ClientWithProject ):
4747 """Client to bundle configuration needed for API requests.
4848
4949 :type project: str
Original file line number Diff line number Diff line change 1515"""Client for interacting with the Google Cloud RuntimeConfig API."""
1616
1717
18- from google .cloud .client import JSONClient
18+ from google .cloud .client import ClientWithProject
1919from google .cloud .runtimeconfig .connection import Connection
2020from google .cloud .runtimeconfig .config import Config
2121
2222
23- class Client (JSONClient ):
23+ class Client (ClientWithProject ):
2424 """Client to bundle configuration needed for API requests.
2525
2626 :type project: str
Original file line number Diff line number Diff line change 1616
1717
1818from google .cloud ._helpers import _LocalStack
19- from google .cloud .client import JSONClient
19+ from google .cloud .client import ClientWithProject
2020from google .cloud .exceptions import NotFound
2121from google .cloud .iterator import HTTPIterator
2222from google .cloud .storage ._http import Connection
2323from google .cloud .storage .batch import Batch
2424from google .cloud .storage .bucket import Bucket
2525
2626
27- class Client (JSONClient ):
27+ class Client (ClientWithProject ):
2828 """Client to bundle configuration needed for API requests.
2929
3030 :type project: str
You can’t perform that action at this time.
0 commit comments