File tree Expand file tree Collapse file tree 11 files changed +97
-0
lines changed
bigquery/google/cloud/bigquery
language/google/cloud/language
logging/google/cloud/logging
monitoring/google/cloud/monitoring
pubsub/google/cloud/pubsub
resource_manager/google/cloud/resource_manager
runtimeconfig/google/cloud/runtimeconfig
speech/google/cloud/speech
translate/google/cloud/translate
vision/google/cloud/vision Expand file tree Collapse file tree 11 files changed +97
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
from google .cloud import _http
18
18
19
+ from google .cloud .bigquery import __version__
20
+
21
+
22
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
23
+
19
24
20
25
class Connection (_http .JSONConnection ):
21
26
"""A connection to Google BigQuery via the JSON REST API.
@@ -32,3 +37,7 @@ class Connection(_http.JSONConnection):
32
37
33
38
API_URL_TEMPLATE = '{api_base_url}/bigquery/{api_version}{path}'
34
39
"""A template for the URL of a particular API call."""
40
+
41
+ _EXTRA_HEADERS = {
42
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
43
+ }
Original file line number Diff line number Diff line change 16
16
17
17
from google .cloud import _http
18
18
19
+ from google .cloud .dns import __version__
20
+
21
+
22
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
23
+
19
24
20
25
class Connection (_http .JSONConnection ):
21
26
"""A connection to Google Cloud DNS via the JSON REST API.
@@ -32,3 +37,7 @@ class Connection(_http.JSONConnection):
32
37
33
38
API_URL_TEMPLATE = '{api_base_url}/dns/{api_version}{path}'
34
39
"""A template for the URL of a particular API call."""
40
+
41
+ _EXTRA_HEADERS = {
42
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
43
+ }
Original file line number Diff line number Diff line change 16
16
17
17
from google .cloud import _http
18
18
19
+ from google .cloud .language import __version__
20
+
21
+
22
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
23
+
19
24
20
25
class Connection (_http .JSONConnection ):
21
26
"""A connection to Google Cloud Natural Language JSON REST API.
@@ -32,3 +37,7 @@ class Connection(_http.JSONConnection):
32
37
33
38
API_URL_TEMPLATE = '{api_base_url}/{api_version}/documents:{path}'
34
39
"""A template for the URL of a particular API call."""
40
+
41
+ _EXTRA_HEADERS = {
42
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
43
+ }
Original file line number Diff line number Diff line change 18
18
19
19
from google .cloud import _http
20
20
from google .cloud .iterator import HTTPIterator
21
+
22
+ from google .cloud .logging import __version__
21
23
from google .cloud .logging ._helpers import entry_from_resource
22
24
from google .cloud .logging .sink import Sink
23
25
from google .cloud .logging .metric import Metric
24
26
25
27
28
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
29
+
30
+
26
31
class Connection (_http .JSONConnection ):
27
32
"""A connection to Google Stackdriver Logging via the JSON REST API.
28
33
@@ -39,6 +44,10 @@ class Connection(_http.JSONConnection):
39
44
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
40
45
"""A template for the URL of a particular API call."""
41
46
47
+ _EXTRA_HEADERS = {
48
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
49
+ }
50
+
42
51
43
52
class _LoggingAPI (object ):
44
53
"""Helper mapping logging-related APIs.
Original file line number Diff line number Diff line change 16
16
17
17
from google .cloud import _http
18
18
19
+ from google .cloud .monitoring import __version__
20
+
21
+
22
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
23
+
19
24
20
25
class Connection (_http .JSONConnection ):
21
26
"""A connection to Google Stackdriver Monitoring via the JSON REST API.
@@ -32,3 +37,7 @@ class Connection(_http.JSONConnection):
32
37
33
38
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
34
39
"""A template for the URL of a particular API call."""
40
+
41
+ _EXTRA_HEADERS = {
42
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
43
+ }
Original file line number Diff line number Diff line change 22
22
from google .cloud import _http
23
23
from google .cloud .environment_vars import PUBSUB_EMULATOR
24
24
from google .cloud .iterator import HTTPIterator
25
+
26
+ from google .cloud .pubsub import __version__
25
27
from google .cloud .pubsub ._helpers import subscription_name_from_path
26
28
from google .cloud .pubsub .subscription import Subscription
27
29
from google .cloud .pubsub .topic import Topic
30
32
PUBSUB_API_HOST = 'pubsub.googleapis.com'
31
33
"""Pub / Sub API request host."""
32
34
35
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
36
+
33
37
34
38
class Connection (_http .JSONConnection ):
35
39
"""A connection to Google Cloud Pub/Sub via the JSON REST API.
@@ -47,6 +51,10 @@ class Connection(_http.JSONConnection):
47
51
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
48
52
"""A template for the URL of a particular API call."""
49
53
54
+ _EXTRA_HEADERS = {
55
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
56
+ }
57
+
50
58
def __init__ (self , client ):
51
59
super (Connection , self ).__init__ (client )
52
60
emulator_host = os .getenv (PUBSUB_EMULATOR )
Original file line number Diff line number Diff line change 17
17
18
18
from google .cloud import _http
19
19
20
+ from google .cloud .resource_manager import __version__
21
+
22
+
23
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
24
+
20
25
21
26
class Connection (_http .JSONConnection ):
22
27
"""A connection to Google Cloud Resource Manager via the JSON REST API.
@@ -33,3 +38,7 @@ class Connection(_http.JSONConnection):
33
38
34
39
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
35
40
"""A template for the URL of a particular API call."""
41
+
42
+ _EXTRA_HEADERS = {
43
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
44
+ }
Original file line number Diff line number Diff line change 18
18
19
19
from google .cloud import _http
20
20
21
+ from google .cloud .runtimeconfig import __version__
22
+
23
+
24
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
25
+
21
26
22
27
class Connection (_http .JSONConnection ):
23
28
"""A connection to Google Cloud RuntimeConfig via the JSON REST API.
@@ -34,3 +39,7 @@ class Connection(_http.JSONConnection):
34
39
35
40
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
36
41
"""A template for the URL of a particular API call."""
42
+
43
+ _EXTRA_HEADERS = {
44
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
45
+ }
Original file line number Diff line number Diff line change 20
20
from google .cloud ._helpers import _to_bytes
21
21
from google .cloud import _http
22
22
23
+ from google .cloud .speech import __version__
23
24
from google .cloud .speech .result import Result
24
25
from google .cloud .speech .operation import Operation
25
26
26
27
28
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
29
+
30
+
27
31
class Connection (_http .JSONConnection ):
28
32
"""A connection to Google Cloud Speech JSON REST API.
29
33
@@ -40,6 +44,10 @@ class Connection(_http.JSONConnection):
40
44
API_URL_TEMPLATE = '{api_base_url}/{api_version}/{path}'
41
45
"""A template for the URL of a particular API call."""
42
46
47
+ _EXTRA_HEADERS = {
48
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
49
+ }
50
+
43
51
44
52
class HTTPSpeechAPI (object ):
45
53
"""Speech API for interacting with the HTTP version of the API.
Original file line number Diff line number Diff line change 16
16
17
17
from google .cloud import _http
18
18
19
+ from google .cloud .translate import __version__
20
+
21
+
22
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
23
+
19
24
20
25
class Connection (_http .JSONConnection ):
21
26
"""A connection to Google Cloud Translation API via the JSON REST API.
@@ -32,3 +37,7 @@ class Connection(_http.JSONConnection):
32
37
33
38
API_URL_TEMPLATE = '{api_base_url}/language/translate/{api_version}{path}'
34
39
"""A template for the URL of a particular API call."""
40
+
41
+ _EXTRA_HEADERS = {
42
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
43
+ }
Original file line number Diff line number Diff line change 14
14
15
15
"""HTTP Client for interacting with the Google Cloud Vision API."""
16
16
17
+
17
18
from google .cloud import _http
18
19
20
+ from google .cloud .vision import __version__
19
21
from google .cloud .vision .annotations import Annotations
20
22
from google .cloud .vision .feature import Feature
21
23
22
24
25
+ _CLIENT_INFO = _http .CLIENT_INFO_TEMPLATE .format (__version__ )
26
+
27
+
23
28
class Connection (_http .JSONConnection ):
24
29
"""A connection to Google Cloud Vision via the JSON REST API.
25
30
@@ -36,6 +41,10 @@ class Connection(_http.JSONConnection):
36
41
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
37
42
"""A template for the URL of a particular API call."""
38
43
44
+ _EXTRA_HEADERS = {
45
+ _http .CLIENT_INFO_HEADER : _CLIENT_INFO ,
46
+ }
47
+
39
48
40
49
class _HTTPVisionAPI (object ):
41
50
"""Vision API for interacting with the JSON/HTTP version of Vision
You can’t perform that action at this time.
0 commit comments