python-service-builder 1.0.2__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/PKG-INFO +1 -1
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/pyproject.toml +1 -1
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/python_service_builder.egg-info/PKG-INFO +1 -1
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/__init_test.py +1 -1
- python_service_builder-1.1.0/service_framework/list_services.py +76 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/services.py +151 -29
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/services_test.py +1 -0
- python-service-builder-1.0.2/service_framework/list_services.py +0 -60
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/README.md +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/python_service_builder.egg-info/SOURCES.txt +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/python_service_builder.egg-info/dependency_links.txt +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/python_service_builder.egg-info/requires.txt +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/python_service_builder.egg-info/top_level.txt +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/__init__.py +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/service_builder.py +0 -0
- {python-service-builder-1.0.2 → python_service_builder-1.1.0}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-service-builder"
|
|
7
|
-
version = "1.0
|
|
7
|
+
version = "1.1.0"
|
|
8
8
|
authors = [{ name = "David Harcombe", email = "david.harcombe@gmail.com" }]
|
|
9
9
|
description = "Helper library for easier creation of Google services."
|
|
10
10
|
readme = "README.md"
|
{python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/__init_test.py
RENAMED
|
@@ -93,7 +93,7 @@ class CamelFieldTest(unittest.TestCase):
|
|
|
93
93
|
f = base.__dataclass_fields__.get('_field')
|
|
94
94
|
self.assertIsNotNone(f.default)
|
|
95
95
|
self.assertTrue(isinstance(f.default_factory, dataclasses._MISSING_TYPE))
|
|
96
|
-
self.
|
|
96
|
+
self.assertEqual(base._field, 'Princess Buttercup')
|
|
97
97
|
|
|
98
98
|
def test_field_with_no_value_is_excluded(self) -> None:
|
|
99
99
|
@dataclass_json
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Copyright 2022 David Harcombe
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from collections import namedtuple
|
|
16
|
+
from pprint import pprint
|
|
17
|
+
from absl import app
|
|
18
|
+
import urllib.request
|
|
19
|
+
from contextlib import closing, suppress
|
|
20
|
+
from urllib.request import urlopen
|
|
21
|
+
import urllib.parse
|
|
22
|
+
import json
|
|
23
|
+
from typing import Mapping
|
|
24
|
+
|
|
25
|
+
""" _summary_
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ServiceLister(object):
|
|
30
|
+
def find_all(self) -> Mapping[str, str]:
|
|
31
|
+
return self.find(None)
|
|
32
|
+
|
|
33
|
+
def find(self, name: str) -> Mapping[str, str]:
|
|
34
|
+
Components = namedtuple(
|
|
35
|
+
typename='Components',
|
|
36
|
+
field_names=['scheme', 'netloc', 'url', 'path', 'query', 'fragment']
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
apis = {}
|
|
40
|
+
|
|
41
|
+
parameters = {'fields': 'items.name,items.version',
|
|
42
|
+
'preferred': 'true'}
|
|
43
|
+
if name:
|
|
44
|
+
parameters |= {'name': name}
|
|
45
|
+
|
|
46
|
+
url = urllib.parse.urlunparse(
|
|
47
|
+
Components(
|
|
48
|
+
scheme='https',
|
|
49
|
+
netloc='www.googleapis.com',
|
|
50
|
+
query=urllib.parse.urlencode(parameters),
|
|
51
|
+
path='',
|
|
52
|
+
url='/discovery/v1/apis',
|
|
53
|
+
fragment=None
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
r = urllib.request.Request(url)
|
|
58
|
+
with closing(urlopen(r)) as _api_list:
|
|
59
|
+
api_list = json.loads(_api_list.read())
|
|
60
|
+
if items := api_list.get('items', None):
|
|
61
|
+
for api in items:
|
|
62
|
+
apis[api['name'].upper()] = (api['name'], api['version'])
|
|
63
|
+
|
|
64
|
+
return apis
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def main(unused) -> None:
|
|
68
|
+
del unused
|
|
69
|
+
|
|
70
|
+
apis = ServiceLister().find(name='CHAT'.lower())
|
|
71
|
+
pprint(apis, indent=2)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
if __name__ == '__main__':
|
|
75
|
+
with suppress(SystemExit):
|
|
76
|
+
app.run(main)
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
16
|
import dataclasses
|
|
17
|
-
import enum
|
|
17
|
+
import aenum as enum
|
|
18
18
|
from typing import Any, Optional
|
|
19
19
|
|
|
20
20
|
import dataclasses_json
|
|
21
21
|
import immutabledict
|
|
22
22
|
|
|
23
23
|
from . import camel_field, lazy_property
|
|
24
|
+
from .list_services import ServiceLister
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
@dataclasses_json.dataclass_json
|
|
@@ -32,6 +33,88 @@ class ServiceDefinition(object):
|
|
|
32
33
|
discovery_service_url: Optional[str] = camel_field()
|
|
33
34
|
|
|
34
35
|
|
|
36
|
+
DEFINITIONS = {'UNDEFINED': ('undefined', 'undefined')}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class ServiceFinder(enum.EnumMeta):
|
|
40
|
+
def __call__(cls, value, *args, **kwargs):
|
|
41
|
+
api = ServiceLister().find(name=value.lower())
|
|
42
|
+
if api:
|
|
43
|
+
(service_name, version) = ('foo', 'v1') # api[value]
|
|
44
|
+
definition = ServiceDefinition(
|
|
45
|
+
service_name=service_name,
|
|
46
|
+
version=version,
|
|
47
|
+
discovery_service_url=(
|
|
48
|
+
f'https://{service_name}.googleapis.com/$discovery/rest'
|
|
49
|
+
f'?version={version}'))
|
|
50
|
+
DEFINITIONS |= {value.upper(): (service_name, version)}
|
|
51
|
+
return definition
|
|
52
|
+
|
|
53
|
+
else:
|
|
54
|
+
raise Exception(f'No service found for {value}')
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class DS(enum.Enum): #, metaclass=ServiceFinder):
|
|
58
|
+
"""Defines the generic Enum for any service.
|
|
59
|
+
|
|
60
|
+
Raises:
|
|
61
|
+
ValueError: if no enum is defined and a service cannot be found.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
@lazy_property
|
|
65
|
+
def definition(self) -> ServiceDefinition:
|
|
66
|
+
"""Fetch the ServiceDefinition.
|
|
67
|
+
|
|
68
|
+
Lazily returns the dataclass containing the service definition
|
|
69
|
+
details. It has to be lazy, as it can't be defined at
|
|
70
|
+
initialization time.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
ServiceDefinition: the service definition
|
|
74
|
+
"""
|
|
75
|
+
(service_name, version) = DEFINITIONS.get(self.name)
|
|
76
|
+
return ServiceDefinition(
|
|
77
|
+
service_name=service_name,
|
|
78
|
+
version=version,
|
|
79
|
+
discovery_service_url=(
|
|
80
|
+
f'https://{service_name}.googleapis.com/$discovery/rest'
|
|
81
|
+
f'?version={version}'))
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_value(cls, value: str) -> DS:
|
|
85
|
+
"""Creates a service enum from the name of the service.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
value (str): the service name
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
ValueError: no service found
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
S: the service definition
|
|
95
|
+
"""
|
|
96
|
+
for k, v in cls.__members__.items():
|
|
97
|
+
if k == value.upper():
|
|
98
|
+
return v.value
|
|
99
|
+
else:
|
|
100
|
+
api = ServiceLister().find(name=value.lower())
|
|
101
|
+
if api:
|
|
102
|
+
(service_name, version) = api[value]
|
|
103
|
+
definition = ServiceDefinition(
|
|
104
|
+
service_name=service_name,
|
|
105
|
+
version=version,
|
|
106
|
+
discovery_service_url=(
|
|
107
|
+
f'https://{service_name}.googleapis.com/$discovery/rest'
|
|
108
|
+
f'?version={version}'))
|
|
109
|
+
enum.extend_enum(cls, value.upper(), definition)
|
|
110
|
+
return definition
|
|
111
|
+
|
|
112
|
+
raise ValueError(f"'{cls.__name__}' enum not found for '{value}'")
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
DynamicService = DS('DynamicService', list(DEFINITIONS.keys()))
|
|
116
|
+
|
|
117
|
+
|
|
35
118
|
class S(enum.Enum):
|
|
36
119
|
"""Defines the generic Enum for any service.
|
|
37
120
|
|
|
@@ -83,16 +166,20 @@ SERVICE_DEFINITIONS = \
|
|
|
83
166
|
'ACCELERATEDMOBILEPAGEURL': ('acceleratedmobilepageurl', 'v1'),
|
|
84
167
|
'ACCESSAPPROVAL': ('accessapproval', 'v1'),
|
|
85
168
|
'ACCESSCONTEXTMANAGER': ('accesscontextmanager', 'v1'),
|
|
169
|
+
'ADDRESSVALIDATION': ('addressvalidation', 'v1'),
|
|
86
170
|
'ADEXCHANGEBUYER2': ('adexchangebuyer2', 'v2beta1'),
|
|
87
171
|
'ADEXPERIENCEREPORT': ('adexperiencereport', 'v1'),
|
|
88
|
-
'ADSDATAHUB': ('adsdatahub', 'v1'),
|
|
89
172
|
'ADMIN': ('admin', 'reports_v1'),
|
|
90
173
|
'ADMOB': ('admob', 'v1'),
|
|
91
174
|
'ADSENSE': ('adsense', 'v2'),
|
|
92
|
-
'
|
|
175
|
+
'ADSENSEPLATFORM': ('adsenseplatform', 'v1'),
|
|
176
|
+
'ADVISORYNOTIFICATIONS': ('advisorynotifications', 'v1'),
|
|
177
|
+
'AIPLATFORM': ('aiplatform', 'v1'),
|
|
178
|
+
'AIRQUALITY': ('airquality', 'v1'),
|
|
93
179
|
'ALERTCENTER': ('alertcenter', 'v1beta1'),
|
|
180
|
+
'ALLOYDB': ('alloydb', 'v1'),
|
|
94
181
|
'ANALYTICS': ('analytics', 'v3'),
|
|
95
|
-
'ANALYTICSADMIN': ('analyticsadmin', '
|
|
182
|
+
'ANALYTICSADMIN': ('analyticsadmin', 'v1beta'),
|
|
96
183
|
'ANALYTICSDATA': ('analyticsdata', 'v1beta'),
|
|
97
184
|
'ANALYTICSHUB': ('analyticshub', 'v1'),
|
|
98
185
|
'ANALYTICSREPORTING': ('analyticsreporting', 'v4'),
|
|
@@ -104,26 +191,34 @@ SERVICE_DEFINITIONS = \
|
|
|
104
191
|
'APIGEE': ('apigee', 'v1'),
|
|
105
192
|
'APIGEEREGISTRY': ('apigeeregistry', 'v1'),
|
|
106
193
|
'APIKEYS': ('apikeys', 'v2'),
|
|
194
|
+
'APIM': ('apim', 'v1alpha'),
|
|
107
195
|
'APPENGINE': ('appengine', 'v1'),
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
196
|
+
'APPHUB': ('apphub', 'v1'),
|
|
197
|
+
'AREA120TABLES': ('area120tables', 'v1aha1'),
|
|
198
|
+
'ARTIFACTREGISTRY': ('artifactregistry''v1'),
|
|
199
|
+
'ASSUREDWORKLOADS': ('assuredworkloads''v1'),
|
|
111
200
|
'AUTHORIZEDBUYERSMARKETPLACE': ('authorizedbuyersmarketplace', 'v1'),
|
|
201
|
+
'BACKUPDR': ('backupdr', 'v1'),
|
|
112
202
|
'BAREMETALSOLUTION': ('baremetalsolution', 'v2'),
|
|
203
|
+
'BATCH': ('batch', 'v1'),
|
|
113
204
|
'BEYONDCORP': ('beyondcorp', 'v1'),
|
|
205
|
+
'BIGLAKE': ('biglake', 'v1'),
|
|
114
206
|
'BIGQUERY': ('bigquery', 'v2'),
|
|
115
|
-
'BIGQUERYCONNECTION': ('bigqueryconnection', '
|
|
207
|
+
'BIGQUERYCONNECTION': ('bigqueryconnection', 'v1'),
|
|
208
|
+
'BIGQUERYDATAPOLICY': ('bigquerydatapolicy', 'v1'),
|
|
116
209
|
'BIGQUERYDATATRANSFER': ('bigquerydatatransfer', 'v1'),
|
|
117
210
|
'BIGQUERYRESERVATION': ('bigqueryreservation', 'v1'),
|
|
118
211
|
'BIGTABLEADMIN': ('bigtableadmin', 'v2'),
|
|
119
212
|
'BILLINGBUDGETS': ('billingbudgets', 'v1'),
|
|
120
213
|
'BINARYAUTHORIZATION': ('binaryauthorization', 'v1'),
|
|
214
|
+
'BLOCKCHAINNODEENGINE': ('blockchainnodeengine', 'v1'),
|
|
121
215
|
'BLOGGER': ('blogger', 'v3'),
|
|
122
216
|
'BOOKS': ('books', 'v1'),
|
|
123
217
|
'BUSINESSPROFILEPERFORMANCE': ('businessprofileperformance', 'v1'),
|
|
124
218
|
'CALENDAR': ('calendar', 'v3'),
|
|
125
219
|
'CERTIFICATEMANAGER': ('certificatemanager', 'v1'),
|
|
126
220
|
'CHAT': ('chat', 'v1'),
|
|
221
|
+
'CHECKS': ('checks', 'v1alpha'),
|
|
127
222
|
'CHROMEMANAGEMENT': ('chromemanagement', 'v1'),
|
|
128
223
|
'CHROMEPOLICY': ('chromepolicy', 'v1'),
|
|
129
224
|
'CHROMEUXREPORT': ('chromeuxreport', 'v1'),
|
|
@@ -131,53 +226,60 @@ SERVICE_DEFINITIONS = \
|
|
|
131
226
|
'CLASSROOM': ('classroom', 'v1'),
|
|
132
227
|
'CLOUDASSET': ('cloudasset', 'v1'),
|
|
133
228
|
'CLOUDBILLING': ('cloudbilling', 'v1'),
|
|
134
|
-
'CLOUDBUILD': ('cloudbuild', '
|
|
229
|
+
'CLOUDBUILD': ('cloudbuild', 'v2'),
|
|
135
230
|
'CLOUDCHANNEL': ('cloudchannel', 'v1'),
|
|
136
|
-
'
|
|
231
|
+
'CLOUDCONTROLSPARTNER': ('cloudcontrolspartner', 'v1'),
|
|
137
232
|
'CLOUDDEPLOY': ('clouddeploy', 'v1'),
|
|
138
233
|
'CLOUDERRORREPORTING': ('clouderrorreporting', 'v1beta1'),
|
|
139
234
|
'CLOUDFUNCTIONS': ('cloudfunctions', 'v2'),
|
|
140
235
|
'CLOUDIDENTITY': ('cloudidentity', 'v1'),
|
|
141
|
-
'CLOUDIOT': ('cloudiot', 'v1'),
|
|
142
236
|
'CLOUDKMS': ('cloudkms', 'v1'),
|
|
143
237
|
'CLOUDPROFILER': ('cloudprofiler', 'v2'),
|
|
144
238
|
'CLOUDRESOURCEMANAGER': ('cloudresourcemanager', 'v3'),
|
|
145
239
|
'CLOUDSCHEDULER': ('cloudscheduler', 'v1'),
|
|
146
240
|
'CLOUDSEARCH': ('cloudsearch', 'v1'),
|
|
147
241
|
'CLOUDSHELL': ('cloudshell', 'v1'),
|
|
148
|
-
'CLOUDSUPPORT': ('cloudsupport', '
|
|
242
|
+
'CLOUDSUPPORT': ('cloudsupport', 'v2'),
|
|
149
243
|
'CLOUDTASKS': ('cloudtasks', 'v2'),
|
|
150
244
|
'CLOUDTRACE': ('cloudtrace', 'v2'),
|
|
151
245
|
'COMPOSER': ('composer', 'v1'),
|
|
152
246
|
'COMPUTE': ('compute', 'v1'),
|
|
247
|
+
'CONFIG': ('config', 'v1'),
|
|
153
248
|
'CONNECTORS': ('connectors', 'v2'),
|
|
249
|
+
'CONTACTCENTERAIPLATFORM': ('contactcenteraiplatform', 'v1alpha1'),
|
|
154
250
|
'CONTACTCENTERINSIGHTS': ('contactcenterinsights', 'v1'),
|
|
155
251
|
'CONTAINER': ('container', 'v1'),
|
|
156
252
|
'CONTAINERANALYSIS': ('containeranalysis', 'v1'),
|
|
157
253
|
'CONTENT': ('content', 'v2.1'),
|
|
254
|
+
'CONTENTWAREHOUSE': ('contentwarehouse', 'v1'),
|
|
255
|
+
'CSS': ('css', 'v1'),
|
|
158
256
|
'CUSTOMSEARCH': ('customsearch', 'v1'),
|
|
159
257
|
'DATACATALOG': ('datacatalog', 'v1'),
|
|
160
258
|
'DATAFLOW': ('dataflow', 'v1b3'),
|
|
259
|
+
'DATAFORM': ('dataform', 'v1beta1'),
|
|
161
260
|
'DATAFUSION': ('datafusion', 'v1'),
|
|
162
261
|
'DATALABELING': ('datalabeling', 'v1beta1'),
|
|
262
|
+
'DATALINEAGE': ('datalineage', 'v1'),
|
|
163
263
|
'DATAMIGRATION': ('datamigration', 'v1'),
|
|
164
264
|
'DATAPIPELINES': ('datapipelines', 'v1'),
|
|
165
265
|
'DATAPLEX': ('dataplex', 'v1'),
|
|
266
|
+
'DATAPORTABILITY': ('dataportability', 'v1'),
|
|
166
267
|
'DATAPROC': ('dataproc', 'v1'),
|
|
167
268
|
'DATASTORE': ('datastore', 'v1'),
|
|
168
269
|
'DATASTREAM': ('datastream', 'v1'),
|
|
169
270
|
'DEPLOYMENTMANAGER': ('deploymentmanager', 'v2'),
|
|
271
|
+
'DEVELOPERCONNECT': ('developerconnect', 'v1'),
|
|
170
272
|
'DFAREPORTING': ('dfareporting', 'v4'),
|
|
171
273
|
'DIALOGFLOW': ('dialogflow', 'v3'),
|
|
172
274
|
'DIGITALASSETLINKS': ('digitalassetlinks', 'v1'),
|
|
173
275
|
'DISCOVERY': ('discovery', 'v1'),
|
|
174
|
-
'
|
|
276
|
+
'DISCOVERYENGINE': ('discoveryengine', 'v1'),
|
|
277
|
+
'DISPLAYVIDEO': ('displayvideo', 'v3'),
|
|
175
278
|
'DLP': ('dlp', 'v2'),
|
|
176
279
|
'DNS': ('dns', 'v1'),
|
|
177
280
|
'DOCS': ('docs', 'v1'),
|
|
178
281
|
'DOCUMENTAI': ('documentai', 'v1'),
|
|
179
282
|
'DOMAINS': ('domains', 'v1'),
|
|
180
|
-
'DOMAINSRDAP': ('domainsrdap', 'v1'),
|
|
181
283
|
'DOUBLECLICKBIDMANAGER': ('doubleclickbidmanager', 'v2'),
|
|
182
284
|
'DOUBLECLICKSEARCH': ('doubleclicksearch', 'v2'),
|
|
183
285
|
'DRIVE': ('drive', 'v3'),
|
|
@@ -191,7 +293,9 @@ SERVICE_DEFINITIONS = \
|
|
|
191
293
|
'FILE': ('file', 'v1'),
|
|
192
294
|
'FIREBASE': ('firebase', 'v1beta1'),
|
|
193
295
|
'FIREBASEAPPCHECK': ('firebaseappcheck', 'v1'),
|
|
296
|
+
'FIREBASEAPPDISTRIBUTION': ('firebaseappdistribution', 'v1'),
|
|
194
297
|
'FIREBASEDATABASE': ('firebasedatabase', 'v1beta'),
|
|
298
|
+
'FIREBASEDATACONNECT': ('firebasedataconnect', 'v1beta'),
|
|
195
299
|
'FIREBASEDYNAMICLINKS': ('firebasedynamiclinks', 'v1'),
|
|
196
300
|
'FIREBASEHOSTING': ('firebasehosting', 'v1'),
|
|
197
301
|
'FIREBASEML': ('firebaseml', 'v1'),
|
|
@@ -202,72 +306,83 @@ SERVICE_DEFINITIONS = \
|
|
|
202
306
|
'FORMS': ('forms', 'v1'),
|
|
203
307
|
'GAMES': ('games', 'v1'),
|
|
204
308
|
'GAMESCONFIGURATION': ('gamesConfiguration', 'v1configuration'),
|
|
205
|
-
'GAMESERVICES': ('gameservices', 'v1'),
|
|
206
309
|
'GAMESMANAGEMENT': ('gamesManagement', 'v1management'),
|
|
207
|
-
'GENOMICS': ('genomics', 'v2alpha1'),
|
|
208
310
|
'GKEBACKUP': ('gkebackup', 'v1'),
|
|
209
|
-
'GKEHUB': ('gkehub', '
|
|
311
|
+
'GKEHUB': ('gkehub', 'v2'),
|
|
312
|
+
'GKEONPREM': ('gkeonprem', 'v1'),
|
|
210
313
|
'GMAIL': ('gmail', 'v1'),
|
|
211
314
|
'GMAILPOSTMASTERTOOLS': ('gmailpostmastertools', 'v1'),
|
|
212
315
|
'GROUPSMIGRATION': ('groupsmigration', 'v1'),
|
|
213
316
|
'GROUPSSETTINGS': ('groupssettings', 'v1'),
|
|
214
317
|
'HEALTHCARE': ('healthcare', 'v1'),
|
|
215
318
|
'HOMEGRAPH': ('homegraph', 'v1'),
|
|
216
|
-
'IAM': ('iam', '
|
|
319
|
+
'IAM': ('iam', 'v2'),
|
|
217
320
|
'IAMCREDENTIALS': ('iamcredentials', 'v1'),
|
|
218
321
|
'IAP': ('iap', 'v1'),
|
|
219
|
-
'IDEAHUB': ('ideahub', 'v1beta'),
|
|
220
322
|
'IDENTITYTOOLKIT': ('identitytoolkit', 'v3'),
|
|
221
323
|
'IDS': ('ids', 'v1'),
|
|
222
324
|
'INDEXING': ('indexing', 'v3'),
|
|
223
|
-
'INTEGRATIONS': ('integrations', '
|
|
325
|
+
'INTEGRATIONS': ('integrations', 'v1'),
|
|
224
326
|
'JOBS': ('jobs', 'v4'),
|
|
225
327
|
'KEEP': ('keep', 'v1'),
|
|
226
328
|
'KGSEARCH': ('kgsearch', 'v1'),
|
|
227
|
-
'
|
|
329
|
+
'KMSINVENTORY': ('kmsinventory', 'v1'),
|
|
330
|
+
'LANGUAGE': ('language', 'v2'),
|
|
228
331
|
'LIBRARYAGENT': ('libraryagent', 'v1'),
|
|
229
332
|
'LICENSING': ('licensing', 'v1'),
|
|
230
333
|
'LIFESCIENCES': ('lifesciences', 'v2beta'),
|
|
231
334
|
'LOCALSERVICES': ('localservices', 'v1'),
|
|
232
335
|
'LOGGING': ('logging', 'v2'),
|
|
336
|
+
'LOOKER': ('looker', 'v1'),
|
|
233
337
|
'MANAGEDIDENTITIES': ('managedidentities', 'v1'),
|
|
234
338
|
'MANUFACTURERS': ('manufacturers', 'v1'),
|
|
339
|
+
'MARKETINGPLATFORMADMIN': ('marketingplatformadmin', 'v1alpha'),
|
|
340
|
+
'MEET': ('meet', 'v2'),
|
|
235
341
|
'MEMCACHE': ('memcache', 'v1'),
|
|
236
|
-
'
|
|
342
|
+
'MERCHANTAPI': ('merchantapi', 'reviews_v1beta'),
|
|
343
|
+
'METASTORE': ('metastore', 'v1'),
|
|
344
|
+
'MIGRATIONCENTER': ('migrationcenter', 'v1'),
|
|
237
345
|
'ML': ('ml', 'v1'),
|
|
238
346
|
'MONITORING': ('monitoring', 'v3'),
|
|
239
347
|
'MYBUSINESSACCOUNTMANAGEMENT': ('mybusinessaccountmanagement', 'v1'),
|
|
240
|
-
'MYBUSINESSBUSINESSCALLS': ('mybusinessbusinesscalls', 'v1'),
|
|
241
348
|
'MYBUSINESSBUSINESSINFORMATION': ('mybusinessbusinessinformation', 'v1'),
|
|
242
349
|
'MYBUSINESSLODGING': ('mybusinesslodging', 'v1'),
|
|
243
350
|
'MYBUSINESSNOTIFICATIONS': ('mybusinessnotifications', 'v1'),
|
|
244
351
|
'MYBUSINESSPLACEACTIONS': ('mybusinessplaceactions', 'v1'),
|
|
245
352
|
'MYBUSINESSQANDA': ('mybusinessqanda', 'v1'),
|
|
246
353
|
'MYBUSINESSVERIFICATIONS': ('mybusinessverifications', 'v1'),
|
|
354
|
+
'NETAPP': ('netapp', 'v1'),
|
|
247
355
|
'NETWORKCONNECTIVITY': ('networkconnectivity', 'v1'),
|
|
248
356
|
'NETWORKMANAGEMENT': ('networkmanagement', 'v1'),
|
|
249
357
|
'NETWORKSECURITY': ('networksecurity', 'v1'),
|
|
250
358
|
'NETWORKSERVICES': ('networkservices', 'v1'),
|
|
251
|
-
'NOTEBOOKS': ('notebooks', '
|
|
359
|
+
'NOTEBOOKS': ('notebooks', 'v2'),
|
|
252
360
|
'OAUTH2': ('oauth2', 'v2'),
|
|
253
361
|
'ONDEMANDSCANNING': ('ondemandscanning', 'v1'),
|
|
362
|
+
'ORACLEDATABASE': ('oracledatabase', 'v1'),
|
|
254
363
|
'ORGPOLICY': ('orgpolicy', 'v2'),
|
|
255
364
|
'OSCONFIG': ('osconfig', 'v1'),
|
|
256
365
|
'OSLOGIN': ('oslogin', 'v1'),
|
|
257
366
|
'PAGESPEEDONLINE': ('pagespeedonline', 'v5'),
|
|
258
367
|
'PAYMENTSRESELLERSUBSCRIPTION': ('paymentsresellersubscription', 'v1'),
|
|
259
368
|
'PEOPLE': ('people', 'v1'),
|
|
369
|
+
'PLACES': ('places', 'v1'),
|
|
260
370
|
'PLAYCUSTOMAPP': ('playcustomapp', 'v1'),
|
|
261
371
|
'PLAYDEVELOPERREPORTING': ('playdeveloperreporting', 'v1beta1'),
|
|
372
|
+
'PLAYGROUPING': ('playgrouping', 'v1alpha1'),
|
|
262
373
|
'PLAYINTEGRITY': ('playintegrity', 'v1'),
|
|
263
374
|
'POLICYANALYZER': ('policyanalyzer', 'v1'),
|
|
264
375
|
'POLICYSIMULATOR': ('policysimulator', 'v1'),
|
|
265
376
|
'POLICYTROUBLESHOOTER': ('policytroubleshooter', 'v1'),
|
|
377
|
+
'POLLEN': ('pollen', 'v1'),
|
|
266
378
|
'POLY': ('poly', 'v1'),
|
|
267
379
|
'PRIVATECA': ('privateca', 'v1'),
|
|
268
380
|
'PROD_TT_SASPORTAL': ('prod_tt_sasportal', 'v1alpha1'),
|
|
381
|
+
'PUBLICCA': ('publicca', 'v1'),
|
|
269
382
|
'PUBSUB': ('pubsub', 'v1'),
|
|
270
383
|
'PUBSUBLITE': ('pubsublite', 'v1'),
|
|
384
|
+
'RAPIDMIGRATIONASSESSMENT': ('rapidmigrationassessment', 'v1'),
|
|
385
|
+
'READERREVENUESUBSCRIPTIONLINKING': ('readerrevenuesubscriptionlinking', 'v1'),
|
|
271
386
|
'REALTIMEBIDDING': ('realtimebidding', 'v1'),
|
|
272
387
|
'RECAPTCHAENTERPRISE': ('recaptchaenterprise', 'v1'),
|
|
273
388
|
'RECOMMENDATIONENGINE': ('recommendationengine', 'v1beta1'),
|
|
@@ -278,9 +393,10 @@ SERVICE_DEFINITIONS = \
|
|
|
278
393
|
'RETAIL': ('retail', 'v2'),
|
|
279
394
|
'RUN': ('run', 'v2'),
|
|
280
395
|
'RUNTIMECONFIG': ('runtimeconfig', 'v1'),
|
|
281
|
-
'SAFEBROWSING': ('safebrowsing', '
|
|
396
|
+
'SAFEBROWSING': ('safebrowsing', 'v5'),
|
|
282
397
|
'SASPORTAL': ('sasportal', 'v1alpha1'),
|
|
283
398
|
'SCRIPT': ('script', 'v1'),
|
|
399
|
+
'SEARCHADS360': ('searchads360', 'v0'),
|
|
284
400
|
'SEARCHCONSOLE': ('searchconsole', 'v1'),
|
|
285
401
|
'SECRETMANAGER': ('secretmanager', 'v1'),
|
|
286
402
|
'SECURITYCENTER': ('securitycenter', 'v1'),
|
|
@@ -294,7 +410,7 @@ SERVICE_DEFINITIONS = \
|
|
|
294
410
|
'SITEVERIFICATION': ('siteVerification', 'v1'),
|
|
295
411
|
'SLIDES': ('slides', 'v1'),
|
|
296
412
|
'SMARTDEVICEMANAGEMENT': ('smartdevicemanagement', 'v1'),
|
|
297
|
-
'
|
|
413
|
+
'SOLAR': ('solar', 'v1'),
|
|
298
414
|
'SPANNER': ('spanner', 'v1'),
|
|
299
415
|
'SPEECH': ('speech', 'v1'),
|
|
300
416
|
'SQLADMIN': ('sqladmin', 'v1'),
|
|
@@ -307,22 +423,28 @@ SERVICE_DEFINITIONS = \
|
|
|
307
423
|
'TESTING': ('testing', 'v1'),
|
|
308
424
|
'TEXTTOSPEECH': ('texttospeech', 'v1'),
|
|
309
425
|
'TOOLRESULTS': ('toolresults', 'v1beta3'),
|
|
310
|
-
'TPU': ('tpu', '
|
|
311
|
-
'TRAFFICDIRECTOR': ('trafficdirector', '
|
|
426
|
+
'TPU': ('tpu', 'v2'),
|
|
427
|
+
'TRAFFICDIRECTOR': ('trafficdirector', 'v3'),
|
|
312
428
|
'TRANSCODER': ('transcoder', 'v1'),
|
|
313
429
|
'TRANSLATE': ('translate', 'v3'),
|
|
430
|
+
'TRAVELIMPACTMODEL': ('travelimpactmodel', 'v1'),
|
|
314
431
|
'VAULT': ('vault', 'v1'),
|
|
315
432
|
'VERIFIEDACCESS': ('verifiedaccess', 'v2'),
|
|
316
433
|
'VERSIONHISTORY': ('versionhistory', 'v1'),
|
|
317
434
|
'VIDEOINTELLIGENCE': ('videointelligence', 'v1'),
|
|
318
435
|
'VISION': ('vision', 'v1'),
|
|
319
436
|
'VMMIGRATION': ('vmmigration', 'v1'),
|
|
437
|
+
'VMWAREENGINE': ('vmwareengine', 'v1'),
|
|
438
|
+
'VPCACCESS': ('vpcaccess', 'v1'),
|
|
439
|
+
'WALLETOBJECTS': ('walletobjects', 'v1'),
|
|
320
440
|
'WEBFONTS': ('webfonts', 'v1'),
|
|
321
441
|
'WEBRISK': ('webrisk', 'v1'),
|
|
322
442
|
'WEBSECURITYSCANNER': ('websecurityscanner', 'v1'),
|
|
323
443
|
'WORKFLOWEXECUTIONS': ('workflowexecutions', 'v1'),
|
|
324
444
|
'WORKFLOWS': ('workflows', 'v1'),
|
|
325
|
-
'
|
|
445
|
+
'WORKLOADMANAGER': ('workloadmanager', 'v1'),
|
|
446
|
+
'WORKSPACEEVENTS': ('workspaceevents', 'v1'),
|
|
447
|
+
'WORKSTATIONS': ('workstations', 'v1'),
|
|
326
448
|
'YOUTUBE': ('youtube', 'v3'),
|
|
327
449
|
'YOUTUBEANALYTICS': ('youtubeAnalytics', 'v2'),
|
|
328
450
|
'YOUTUBEREPORTING': ('youtubereporting', 'v1')})
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Copyright 2022 David Harcombe
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from collections import namedtuple
|
|
16
|
-
from pprint import pprint
|
|
17
|
-
from absl import app
|
|
18
|
-
import urllib.request
|
|
19
|
-
from contextlib import closing, suppress
|
|
20
|
-
from urllib.request import urlopen
|
|
21
|
-
import urllib.parse
|
|
22
|
-
import json
|
|
23
|
-
|
|
24
|
-
""" _summary_
|
|
25
|
-
"""
|
|
26
|
-
def main(unused):
|
|
27
|
-
del unused
|
|
28
|
-
|
|
29
|
-
Components = namedtuple(
|
|
30
|
-
typename='Components',
|
|
31
|
-
field_names=['scheme', 'netloc', 'url', 'path', 'query', 'fragment']
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
apis = {}
|
|
35
|
-
|
|
36
|
-
url = urllib.parse.urlunparse(
|
|
37
|
-
Components(
|
|
38
|
-
scheme='https',
|
|
39
|
-
netloc='www.googleapis.com',
|
|
40
|
-
query=urllib.parse.urlencode({'fields': 'items.name,items.version',
|
|
41
|
-
'preferred': 'true'}),
|
|
42
|
-
path='',
|
|
43
|
-
url='/discovery/v1/apis',
|
|
44
|
-
fragment=None
|
|
45
|
-
)
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
r = urllib.request.Request(url)
|
|
49
|
-
with closing(urlopen(r)) as _api_list:
|
|
50
|
-
api_list = json.loads(_api_list.read())
|
|
51
|
-
if items := api_list.get('items', None):
|
|
52
|
-
for api in items:
|
|
53
|
-
apis[api['name'].upper()] = (api['name'], api['version'])
|
|
54
|
-
|
|
55
|
-
pprint(apis)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if __name__ == '__main__':
|
|
59
|
-
with suppress(SystemExit):
|
|
60
|
-
app.run(main)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-service-builder-1.0.2 → python_service_builder-1.1.0}/service_framework/service_builder.py
RENAMED
|
File without changes
|
|
File without changes
|