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
11 files changed +22
-25
lines changed Original file line number Diff line number Diff line change 15
15
"""Client for interacting with the Google BigQuery API."""
16
16
17
17
18
- from google .cloud .client import JSONClient
18
+ from google .cloud .client import ClientWithProject
19
19
from google .cloud .bigquery ._http import Connection
20
20
from google .cloud .bigquery .dataset import Dataset
21
21
from google .cloud .bigquery .job import CopyJob
@@ -50,7 +50,7 @@ def from_api_repr(cls, resource):
50
50
resource ['id' ], resource ['numericId' ], resource ['friendlyName' ])
51
51
52
52
53
- class Client (JSONClient ):
53
+ class Client (ClientWithProject ):
54
54
"""Client to bundle configuration needed for API requests.
55
55
56
56
:type project: str
Original file line number Diff line number Diff line change @@ -129,11 +129,8 @@ def _determine_default(project):
129
129
return _determine_default_project (project )
130
130
131
131
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.
137
134
138
135
:type project: str
139
136
: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):
789
789
credentials = object ()
790
790
user_agent = 'you-sir-age-int'
791
791
host = 'localhost'
792
- extra_options = {'extra_options' : None }
792
+ extra_options = {'extra_options' : () }
793
793
with _Monkey (MUT , make_secure_channel = mock_channel ):
794
794
stub = self ._call_fut (credentials , user_agent ,
795
795
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):
104
104
mock .sentinel .filename , credentials = mock .sentinel .credentials )
105
105
106
106
107
- class TestJSONClient (unittest .TestCase ):
107
+ class TestClientWithProject (unittest .TestCase ):
108
108
109
109
@staticmethod
110
110
def _get_target_class ():
111
- from google .cloud .client import JSONClient
111
+ from google .cloud .client import ClientWithProject
112
112
113
- return JSONClient
113
+ return ClientWithProject
114
114
115
115
def _make_one (self , * args , ** kw ):
116
116
return self ._get_target_class ()(* args , ** kw )
Original file line number Diff line number Diff line change 15
15
"""Client for interacting with the Google Cloud DNS API."""
16
16
17
17
18
- from google .cloud .client import JSONClient
18
+ from google .cloud .client import ClientWithProject
19
19
from google .cloud .dns .connection import Connection
20
20
from google .cloud .dns .zone import ManagedZone
21
21
from google .cloud .iterator import HTTPIterator
22
22
23
23
24
- class Client (JSONClient ):
24
+ class Client (ClientWithProject ):
25
25
"""Client to bundle configuration needed for API requests.
26
26
27
27
:type project: str
Original file line number Diff line number Diff line change 29
29
else :
30
30
_HAVE_GAX = True
31
31
32
- from google .cloud .client import JSONClient
32
+ from google .cloud .client import ClientWithProject
33
33
from google .cloud .environment_vars import DISABLE_GRPC
34
34
from google .cloud .logging ._http import Connection
35
35
from google .cloud .logging ._http import _LoggingAPI as JSONLoggingAPI
59
59
"""Environment variable set in a Google Container Engine environment."""
60
60
61
61
62
- class Client (JSONClient ):
62
+ class Client (ClientWithProject ):
63
63
"""Client to bundle configuration needed for API requests.
64
64
65
65
:type project: str
Original file line number Diff line number Diff line change 31
31
import datetime
32
32
33
33
from google .cloud ._helpers import _datetime_to_rfc3339
34
- from google .cloud .client import JSONClient
34
+ from google .cloud .client import ClientWithProject
35
35
from google .cloud .monitoring .connection import Connection
36
36
from google .cloud .monitoring .group import Group
37
37
from google .cloud .monitoring .metric import Metric
47
47
_UTCNOW = datetime .datetime .utcnow # To be replaced by tests.
48
48
49
49
50
- class Client (JSONClient ):
50
+ class Client (ClientWithProject ):
51
51
"""Client to bundle configuration needed for API requests.
52
52
53
53
:type project: str
Original file line number Diff line number Diff line change 16
16
17
17
import os
18
18
19
- from google .cloud .client import JSONClient
19
+ from google .cloud .client import ClientWithProject
20
20
from google .cloud .environment_vars import DISABLE_GRPC
21
21
from google .cloud .pubsub ._http import Connection
22
22
from google .cloud .pubsub ._http import _PublisherAPI as JSONPublisherAPI
43
43
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX
44
44
45
45
46
- class Client (JSONClient ):
46
+ class Client (ClientWithProject ):
47
47
"""Client to bundle configuration needed for API requests.
48
48
49
49
:type project: str
Original file line number Diff line number Diff line change 15
15
"""Client for interacting with the Google Cloud RuntimeConfig API."""
16
16
17
17
18
- from google .cloud .client import JSONClient
18
+ from google .cloud .client import ClientWithProject
19
19
from google .cloud .runtimeconfig .connection import Connection
20
20
from google .cloud .runtimeconfig .config import Config
21
21
22
22
23
- class Client (JSONClient ):
23
+ class Client (ClientWithProject ):
24
24
"""Client to bundle configuration needed for API requests.
25
25
26
26
:type project: str
Original file line number Diff line number Diff line change 16
16
17
17
18
18
from google .cloud ._helpers import _LocalStack
19
- from google .cloud .client import JSONClient
19
+ from google .cloud .client import ClientWithProject
20
20
from google .cloud .exceptions import NotFound
21
21
from google .cloud .iterator import HTTPIterator
22
22
from google .cloud .storage ._http import Connection
23
23
from google .cloud .storage .batch import Batch
24
24
from google .cloud .storage .bucket import Bucket
25
25
26
26
27
- class Client (JSONClient ):
27
+ class Client (ClientWithProject ):
28
28
"""Client to bundle configuration needed for API requests.
29
29
30
30
:type project: str
Original file line number Diff line number Diff line change 16
16
17
17
import os
18
18
19
- from google .cloud .client import JSONClient
19
+ from google .cloud .client import ClientWithProject
20
20
from google .cloud .environment_vars import DISABLE_GRPC
21
21
22
22
from google .cloud .vision ._gax import _GAPICVisionAPI
28
28
_USE_GAX = not os .getenv (DISABLE_GRPC , False )
29
29
30
30
31
- class Client (JSONClient ):
31
+ class Client (ClientWithProject ):
32
32
"""Client to bundle configuration needed for API requests.
33
33
34
34
:type project: str
You can’t perform that action at this time.
0 commit comments