gam7 7.3.4__py3-none-any.whl
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.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +77555 -0
- gam/__main__.py +40 -0
- gam/atom/__init__.py +1460 -0
- gam/atom/auth.py +41 -0
- gam/atom/client.py +214 -0
- gam/atom/core.py +535 -0
- gam/atom/data.py +327 -0
- gam/atom/http.py +354 -0
- gam/atom/http_core.py +599 -0
- gam/atom/http_interface.py +144 -0
- gam/atom/mock_http.py +123 -0
- gam/atom/mock_http_core.py +313 -0
- gam/atom/mock_service.py +235 -0
- gam/atom/service.py +723 -0
- gam/atom/token_store.py +105 -0
- gam/atom/url.py +130 -0
- gam/cacerts.pem +1130 -0
- gam/cbcm-v1.1beta1.json +593 -0
- gam/contactdelegation-v1.json +249 -0
- gam/datastudio-v1.json +486 -0
- gam/gamlib/__init__.py +17 -0
- gam/gamlib/glaction.py +308 -0
- gam/gamlib/glapi.py +837 -0
- gam/gamlib/glcfg.py +616 -0
- gam/gamlib/glclargs.py +1184 -0
- gam/gamlib/glentity.py +831 -0
- gam/gamlib/glgapi.py +817 -0
- gam/gamlib/glgdata.py +98 -0
- gam/gamlib/glglobals.py +307 -0
- gam/gamlib/glindent.py +46 -0
- gam/gamlib/glmsgs.py +547 -0
- gam/gamlib/glskus.py +246 -0
- gam/gamlib/gluprop.py +279 -0
- gam/gamlib/glverlibs.py +33 -0
- gam/gamlib/yubikey.py +202 -0
- gam/gdata/__init__.py +825 -0
- gam/gdata/alt/__init__.py +20 -0
- gam/gdata/alt/app_engine.py +101 -0
- gam/gdata/alt/appengine.py +321 -0
- gam/gdata/apps/__init__.py +526 -0
- gam/gdata/apps/audit/__init__.py +1 -0
- gam/gdata/apps/audit/service.py +278 -0
- gam/gdata/apps/contacts/__init__.py +874 -0
- gam/gdata/apps/contacts/service.py +355 -0
- gam/gdata/apps/service.py +544 -0
- gam/gdata/apps/sites/__init__.py +283 -0
- gam/gdata/apps/sites/service.py +246 -0
- gam/gdata/service.py +1714 -0
- gam/gdata/urlfetch.py +247 -0
- gam/googleapiclient/__init__.py +27 -0
- gam/googleapiclient/_auth.py +167 -0
- gam/googleapiclient/_helpers.py +207 -0
- gam/googleapiclient/channel.py +315 -0
- gam/googleapiclient/discovery.py +1662 -0
- gam/googleapiclient/discovery_cache/__init__.py +78 -0
- gam/googleapiclient/discovery_cache/appengine_memcache.py +55 -0
- gam/googleapiclient/discovery_cache/base.py +46 -0
- gam/googleapiclient/discovery_cache/file_cache.py +145 -0
- gam/googleapiclient/errors.py +197 -0
- gam/googleapiclient/http.py +1962 -0
- gam/googleapiclient/mimeparse.py +183 -0
- gam/googleapiclient/model.py +429 -0
- gam/googleapiclient/schema.py +317 -0
- gam/googleapiclient/version.py +15 -0
- gam/iso8601/__init__.py +28 -0
- gam/iso8601/iso8601.py +160 -0
- gam/serviceaccountlookup-v1.json +141 -0
- gam/six.py +982 -0
- gam7-7.3.4.dist-info/METADATA +69 -0
- gam7-7.3.4.dist-info/RECORD +72 -0
- gam7-7.3.4.dist-info/WHEEL +4 -0
- gam7-7.3.4.dist-info/licenses/LICENSE +201 -0
gam/gamlib/glapi.py
ADDED
|
@@ -0,0 +1,837 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# All Rights Reserved.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
# not use this file except in compliance with the License. You may obtain
|
|
9
|
+
# a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16
|
+
# License for the specific language governing permissions and limitations
|
|
17
|
+
# under the License.
|
|
18
|
+
|
|
19
|
+
"""Google API resources
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
# APIs
|
|
23
|
+
ACCESSCONTEXTMANAGER = 'accesscontextmanager'
|
|
24
|
+
ALERTCENTER = 'alertcenter'
|
|
25
|
+
ANALYTICS = 'analytics'
|
|
26
|
+
ANALYTICS_ADMIN = 'analyticsadmin'
|
|
27
|
+
CALENDAR = 'calendar'
|
|
28
|
+
CBCM = 'cbcm'
|
|
29
|
+
CHAT = 'chat'
|
|
30
|
+
CHAT_EVENTS = 'chatevents'
|
|
31
|
+
CHAT_MEMBERSHIPS = 'chatmemberships'
|
|
32
|
+
CHAT_MEMBERSHIPS_ADMIN = 'chatmembershipsadmin'
|
|
33
|
+
CHAT_MESSAGES = 'chatmessages'
|
|
34
|
+
CHAT_SPACES = 'chatspaces'
|
|
35
|
+
CHAT_SPACES_ADMIN = 'chatspacesadmin'
|
|
36
|
+
CHAT_SPACES_DELETE = 'chatspacesdelete'
|
|
37
|
+
CHAT_SPACES_DELETE_ADMIN = 'chatspacesdeleteadmin'
|
|
38
|
+
CHROMEMANAGEMENT = 'chromemanagement'
|
|
39
|
+
CHROMEMANAGEMENT_APPDETAILS = 'chromemanagementappdetails'
|
|
40
|
+
CHROMEMANAGEMENT_CHROMEPROFILES = 'chromemanagementchromeprofiles'
|
|
41
|
+
CHROMEMANAGEMENT_TELEMETRY = 'chromemanagementtelemetry'
|
|
42
|
+
CHROMEPOLICY = 'chromepolicy'
|
|
43
|
+
CHROMEVERSIONHISTORY = 'versionhistory'
|
|
44
|
+
CLASSROOM = 'classroom'
|
|
45
|
+
CLOUDCHANNEL = 'cloudchannel'
|
|
46
|
+
CLOUDIDENTITY_DEVICES = 'cloudidentitydevices'
|
|
47
|
+
CLOUDIDENTITY_GROUPS = 'cloudidentitygroups'
|
|
48
|
+
CLOUDIDENTITY_GROUPS_BETA = 'cloudidentitygroupsbeta'
|
|
49
|
+
CLOUDIDENTITY_INBOUND_SSO = 'cloudidentityinboundsso'
|
|
50
|
+
CLOUDIDENTITY_ORGUNITS = 'cloudidentityorgunits'
|
|
51
|
+
CLOUDIDENTITY_ORGUNITS_BETA = 'cloudidentityorgunitsbeta'
|
|
52
|
+
CLOUDIDENTITY_POLICY = 'cloudidentitypolicy'
|
|
53
|
+
CLOUDIDENTITY_USERINVITATIONS = 'cloudidentityuserinvitations'
|
|
54
|
+
CLOUDRESOURCEMANAGER = 'cloudresourcemanager'
|
|
55
|
+
CONTACTS = 'contacts'
|
|
56
|
+
CONTACTDELEGATION = 'contactdelegation'
|
|
57
|
+
DATATRANSFER = 'datatransfer'
|
|
58
|
+
DIRECTORY = 'directory'
|
|
59
|
+
DOCS = 'docs'
|
|
60
|
+
DRIVE2 = 'drive2'
|
|
61
|
+
DRIVE3 = 'drive3'
|
|
62
|
+
DRIVETD = 'drivetd'
|
|
63
|
+
DRIVEACTIVITY = 'driveactivity'
|
|
64
|
+
DRIVELABELS = 'drivelabels'
|
|
65
|
+
DRIVELABELS_ADMIN = 'drivelabelsadmin'
|
|
66
|
+
DRIVELABELS_USER = 'drivelabelsuser'
|
|
67
|
+
EMAIL_AUDIT = 'email-audit'
|
|
68
|
+
FORMS = 'forms'
|
|
69
|
+
GMAIL = 'gmail'
|
|
70
|
+
GROUPSMIGRATION = 'groupsmigration'
|
|
71
|
+
GROUPSSETTINGS = 'groupssettings'
|
|
72
|
+
IAM = 'iam'
|
|
73
|
+
IAM_CREDENTIALS = 'iamcredentials'
|
|
74
|
+
KEEP = 'keep'
|
|
75
|
+
LICENSING = 'licensing'
|
|
76
|
+
LOOKERSTUDIO = 'datastudio'
|
|
77
|
+
MEET = 'meet'
|
|
78
|
+
OAUTH2 = 'oauth2'
|
|
79
|
+
ORGPOLICY = 'orgpolicy'
|
|
80
|
+
PEOPLE = 'people'
|
|
81
|
+
PEOPLE_DIRECTORY = 'peopledirectory'
|
|
82
|
+
PEOPLE_OTHERCONTACTS = 'peopleothercontacts'
|
|
83
|
+
PRINTERS = 'printers'
|
|
84
|
+
PUBSUB = 'pubsub'
|
|
85
|
+
REPORTS = 'reports'
|
|
86
|
+
RESELLER = 'reseller'
|
|
87
|
+
SERVICEACCOUNTLOOKUP = 'serviceaccountlookup'
|
|
88
|
+
SERVICEMANAGEMENT = 'servicemanagement'
|
|
89
|
+
SERVICEUSAGE = 'serviceusage'
|
|
90
|
+
SHEETS = 'sheets'
|
|
91
|
+
SHEETSTD = 'sheetstd'
|
|
92
|
+
SITES = 'sites'
|
|
93
|
+
SITEVERIFICATION = 'siteVerification'
|
|
94
|
+
STORAGE = 'storage'
|
|
95
|
+
STORAGEREAD = 'storageread'
|
|
96
|
+
STORAGEWRITE = 'storagewrite'
|
|
97
|
+
TASKS = 'tasks'
|
|
98
|
+
VAULT = 'vault'
|
|
99
|
+
YOUTUBE = 'youtube'
|
|
100
|
+
#
|
|
101
|
+
CHROMEVERSIONHISTORY_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms'
|
|
102
|
+
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive'
|
|
103
|
+
GMAIL_SEND_SCOPE = 'https://www.googleapis.com/auth/gmail.send'
|
|
104
|
+
GOOGLE_AUTH_PROVIDER_X509_CERT_URL = 'https://www.googleapis.com/oauth2/v1/certs'
|
|
105
|
+
GOOGLE_OAUTH2_ENDPOINT = 'https://accounts.google.com/o/oauth2/v2/auth'
|
|
106
|
+
GOOGLE_OAUTH2_TOKEN_ENDPOINT = 'https://oauth2.googleapis.com/token'
|
|
107
|
+
CLOUD_PLATFORM_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'
|
|
108
|
+
IAM_SCOPE = 'https://www.googleapis.com/auth/iam'
|
|
109
|
+
PEOPLE_SCOPE = 'https://www.googleapis.com/auth/contacts'
|
|
110
|
+
STORAGE_READONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'
|
|
111
|
+
STORAGE_READWRITE_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_write'
|
|
112
|
+
USERINFO_EMAIL_SCOPE = 'https://www.googleapis.com/auth/userinfo.email' # email
|
|
113
|
+
USERINFO_PROFILE_SCOPE = 'https://www.googleapis.com/auth/userinfo.profile' # profile
|
|
114
|
+
VAULT_SCOPES = ['https://www.googleapis.com/auth/ediscovery', 'https://www.googleapis.com/auth/ediscovery.readonly']
|
|
115
|
+
REQUIRED_SCOPES = [USERINFO_EMAIL_SCOPE, USERINFO_PROFILE_SCOPE]
|
|
116
|
+
REQUIRED_SCOPES_SET = set(REQUIRED_SCOPES)
|
|
117
|
+
#
|
|
118
|
+
JWT_APIS = {
|
|
119
|
+
ACCESSCONTEXTMANAGER: [CLOUD_PLATFORM_SCOPE],
|
|
120
|
+
CHAT: ['https://www.googleapis.com/auth/chat.bot'],
|
|
121
|
+
CLOUDRESOURCEMANAGER: [CLOUD_PLATFORM_SCOPE],
|
|
122
|
+
ORGPOLICY: [CLOUD_PLATFORM_SCOPE],
|
|
123
|
+
}
|
|
124
|
+
#
|
|
125
|
+
SCOPELESS_APIS = {
|
|
126
|
+
CHROMEVERSIONHISTORY,
|
|
127
|
+
OAUTH2,
|
|
128
|
+
SERVICEACCOUNTLOOKUP,
|
|
129
|
+
}
|
|
130
|
+
#
|
|
131
|
+
APIS_NEEDING_ACCESS_TOKEN = {
|
|
132
|
+
CBCM: ['https://www.googleapis.com/auth/admin.directory.device.chromebrowsers']
|
|
133
|
+
}
|
|
134
|
+
#
|
|
135
|
+
REFRESH_PERM_ERRORS = [
|
|
136
|
+
'invalid_grant: reauth related error (rapt_required)', # no way to reauth today
|
|
137
|
+
'invalid_grant: Token has been expired or revoked',
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
OAUTH2_TOKEN_ERRORS = [
|
|
141
|
+
'access_denied',
|
|
142
|
+
'access_denied: Requested client not authorized',
|
|
143
|
+
'access_denied: Account restricted',
|
|
144
|
+
'internal_failure: Backend Error',
|
|
145
|
+
'internal_failure: None',
|
|
146
|
+
'invalid_grant',
|
|
147
|
+
'invalid_grant: Bad Request',
|
|
148
|
+
'invalid_grant: Invalid email or User ID',
|
|
149
|
+
'invalid_grant: Not a valid email',
|
|
150
|
+
'invalid_grant: Invalid JWT: No valid verifier found for issuer',
|
|
151
|
+
'invalid_grant: reauth related error (invalid_rapt)',
|
|
152
|
+
'invalid_grant: The account has been deleted',
|
|
153
|
+
'invalid_request: Invalid impersonation prn email address'
|
|
154
|
+
]
|
|
155
|
+
OAUTH2_UNAUTHORIZED_ERRORS = [
|
|
156
|
+
'unauthorized_client: Client is unauthorized to retrieve access tokens using this method',
|
|
157
|
+
'unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested',
|
|
158
|
+
'unauthorized_client: Unauthorized client or scope in request',
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
PROJECT_APIS = [
|
|
162
|
+
'accesscontextmanager.googleapis.com',
|
|
163
|
+
'admin.googleapis.com',
|
|
164
|
+
'alertcenter.googleapis.com',
|
|
165
|
+
'analytics.googleapis.com',
|
|
166
|
+
'analyticsadmin.googleapis.com',
|
|
167
|
+
# 'audit.googleapis.com',
|
|
168
|
+
'calendar-json.googleapis.com',
|
|
169
|
+
'chat.googleapis.com',
|
|
170
|
+
'chromemanagement.googleapis.com',
|
|
171
|
+
'chromepolicy.googleapis.com',
|
|
172
|
+
'classroom.googleapis.com',
|
|
173
|
+
'cloudchannel.googleapis.com',
|
|
174
|
+
'cloudidentity.googleapis.com',
|
|
175
|
+
'cloudresourcemanager.googleapis.com',
|
|
176
|
+
'contacts.googleapis.com',
|
|
177
|
+
'datastudio.googleapis.com',
|
|
178
|
+
'docs.googleapis.com',
|
|
179
|
+
'drive.googleapis.com',
|
|
180
|
+
'driveactivity.googleapis.com',
|
|
181
|
+
'drivelabels.googleapis.com',
|
|
182
|
+
'forms.googleapis.com',
|
|
183
|
+
'gmail.googleapis.com',
|
|
184
|
+
'groupsmigration.googleapis.com',
|
|
185
|
+
'groupssettings.googleapis.com',
|
|
186
|
+
'iam.googleapis.com',
|
|
187
|
+
'keep.googleapis.com',
|
|
188
|
+
'licensing.googleapis.com',
|
|
189
|
+
'meet.googleapis.com',
|
|
190
|
+
'people.googleapis.com',
|
|
191
|
+
'pubsub.googleapis.com',
|
|
192
|
+
'reseller.googleapis.com',
|
|
193
|
+
'sheets.googleapis.com',
|
|
194
|
+
'siteverification.googleapis.com',
|
|
195
|
+
'storage-api.googleapis.com',
|
|
196
|
+
'tasks.googleapis.com',
|
|
197
|
+
'vault.googleapis.com',
|
|
198
|
+
'youtube.googleapis.com',
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
_INFO = {
|
|
202
|
+
ACCESSCONTEXTMANAGER: {'name': 'Access Context Manager API', 'version': 'v1', 'v2discovery': True},
|
|
203
|
+
ALERTCENTER: {'name': 'AlertCenter API', 'version': 'v1beta1', 'v2discovery': True},
|
|
204
|
+
ANALYTICS: {'name': 'Analytics API', 'version': 'v3', 'v2discovery': False},
|
|
205
|
+
ANALYTICS_ADMIN: {'name': 'Analytics Admin API', 'version': 'v1beta', 'v2discovery': True},
|
|
206
|
+
CALENDAR: {'name': 'Calendar API', 'version': 'v3', 'v2discovery': True, 'mappedAPI': 'calendar-json'},
|
|
207
|
+
CBCM: {'name': 'Chrome Browser Cloud Management API', 'version': 'v1.1beta1', 'v2discovery': True, 'localjson': True},
|
|
208
|
+
CHAT: {'name': 'Chat API', 'version': 'v1', 'v2discovery': True},
|
|
209
|
+
CHAT_EVENTS: {'name': 'Chat API - Events', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
210
|
+
CHAT_MEMBERSHIPS: {'name': 'Chat API - Memberships', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
211
|
+
CHAT_MEMBERSHIPS_ADMIN: {'name': 'Chat API - Memberships Admin', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
212
|
+
CHAT_MESSAGES: {'name': 'Chat API - Messages', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
213
|
+
CHAT_SPACES: {'name': 'Chat API - Spaces', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
214
|
+
CHAT_SPACES_ADMIN: {'name': 'Chat API - Spaces Admin', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
215
|
+
CHAT_SPACES_DELETE: {'name': 'Chat API - Spaces Delete', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
216
|
+
CHAT_SPACES_DELETE_ADMIN: {'name': 'Chat API - Spaces Delete Admin', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
|
|
217
|
+
CLASSROOM: {'name': 'Classroom API', 'version': 'v1', 'v2discovery': True},
|
|
218
|
+
CHROMEMANAGEMENT: {'name': 'Chrome Management API', 'version': 'v1', 'v2discovery': True},
|
|
219
|
+
CHROMEMANAGEMENT_APPDETAILS: {'name': 'Chrome Management API - AppDetails', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHROMEMANAGEMENT},
|
|
220
|
+
CHROMEMANAGEMENT_TELEMETRY: {'name': 'Chrome Management API - Telemetry', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHROMEMANAGEMENT},
|
|
221
|
+
CHROMEPOLICY: {'name': 'Chrome Policy API', 'version': 'v1', 'v2discovery': True},
|
|
222
|
+
CHROMEVERSIONHISTORY: {'name': 'Chrome Version History API', 'version': 'v1', 'v2discovery': True},
|
|
223
|
+
CLOUDCHANNEL: {'name': 'Channel Channel API', 'version': 'v1', 'v2discovery': True},
|
|
224
|
+
CLOUDIDENTITY_DEVICES: {'name': 'Cloud Identity Devices API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
225
|
+
CLOUDIDENTITY_GROUPS: {'name': 'Cloud Identity Groups API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
226
|
+
CLOUDIDENTITY_GROUPS_BETA: {'name': 'Cloud Identity Groups API', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
227
|
+
CLOUDIDENTITY_INBOUND_SSO: {'name': 'Cloud Identity Inbound SSO API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
228
|
+
CLOUDIDENTITY_ORGUNITS: {'name': 'Cloud Identity OrgUnits API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
229
|
+
CLOUDIDENTITY_ORGUNITS_BETA: {'name': 'Cloud Identity OrgUnits API', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
230
|
+
CLOUDIDENTITY_POLICY: {'name': 'Cloud Identity Policy API', 'version': 'v1beta1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
231
|
+
CLOUDIDENTITY_USERINVITATIONS: {'name': 'Cloud Identity User Invitations API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': 'cloudidentity'},
|
|
232
|
+
CLOUDRESOURCEMANAGER: {'name': 'Cloud Resource Manager API v3', 'version': 'v3', 'v2discovery': True},
|
|
233
|
+
CONTACTS: {'name': 'Contacts API', 'version': 'v3', 'v2discovery': False},
|
|
234
|
+
CONTACTDELEGATION: {'name': 'Contact Delegation API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
|
|
235
|
+
DATATRANSFER: {'name': 'Data Transfer API', 'version': 'datatransfer_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
|
236
|
+
DIRECTORY: {'name': 'Directory API', 'version': 'directory_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
|
237
|
+
DOCS: {'name': 'Docs API', 'version': 'v1', 'v2discovery': True},
|
|
238
|
+
DRIVE2: {'name': 'Drive API v2', 'version': 'v2', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
239
|
+
DRIVE3: {'name': 'Drive API v3', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
240
|
+
DRIVETD: {'name': 'Drive API v3 - todrive', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
241
|
+
DRIVEACTIVITY: {'name': 'Drive Activity API v2', 'version': 'v2', 'v2discovery': True},
|
|
242
|
+
DRIVELABELS_ADMIN: {'name': 'Drive Labels API - Admin', 'version': 'v2', 'v2discovery': True, 'mappedAPI': DRIVELABELS},
|
|
243
|
+
DRIVELABELS_USER: {'name': 'Drive Labels API - User', 'version': 'v2', 'v2discovery': True, 'mappedAPI': DRIVELABELS},
|
|
244
|
+
EMAIL_AUDIT: {'name': 'Email Audit API', 'version': 'v1', 'v2discovery': False},
|
|
245
|
+
FORMS: {'name': 'Forms API', 'version': 'v1', 'v2discovery': True},
|
|
246
|
+
GMAIL: {'name': 'Gmail API', 'version': 'v1', 'v2discovery': True},
|
|
247
|
+
GROUPSMIGRATION: {'name': 'Groups Migration API', 'version': 'v1', 'v2discovery': False},
|
|
248
|
+
GROUPSSETTINGS: {'name': 'Groups Settings API', 'version': 'v1', 'v2discovery': True},
|
|
249
|
+
IAM: {'name': 'Identity and Access Management API', 'version': 'v1', 'v2discovery': True},
|
|
250
|
+
IAM_CREDENTIALS: {'name': 'Identity and Access Management Credentials API', 'version': 'v1', 'v2discovery': True},
|
|
251
|
+
KEEP: {'name': 'Keep API', 'version': 'v1', 'v2discovery': True},
|
|
252
|
+
LICENSING: {'name': 'License Manager API', 'version': 'v1', 'v2discovery': True},
|
|
253
|
+
LOOKERSTUDIO: {'name': 'Looker Studio API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
|
|
254
|
+
MEET: {'name': 'Meet API', 'version': 'v2', 'v2discovery': True},
|
|
255
|
+
OAUTH2: {'name': 'OAuth2 API', 'version': 'v2', 'v2discovery': False},
|
|
256
|
+
ORGPOLICY: {'name': 'Organization Policy API', 'version': 'v2', 'v2discovery': True},
|
|
257
|
+
PEOPLE: {'name': 'People API', 'version': 'v1', 'v2discovery': True},
|
|
258
|
+
PEOPLE_DIRECTORY: {'name': 'People Directory API', 'version': 'v1', 'v2discovery': True, 'mappedAPI': PEOPLE},
|
|
259
|
+
PEOPLE_OTHERCONTACTS: {'name': 'People API - Other Contacts', 'version': 'v1', 'v2discovery': True, 'mappedAPI': PEOPLE},
|
|
260
|
+
PRINTERS: {'name': 'Directory API Printers', 'version': 'directory_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
|
261
|
+
PUBSUB: {'name': 'Pub / Sub API', 'version': 'v1', 'v2discovery': True},
|
|
262
|
+
REPORTS: {'name': 'Reports API', 'version': 'reports_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
|
263
|
+
RESELLER: {'name': 'Reseller API', 'version': 'v1', 'v2discovery': True},
|
|
264
|
+
SERVICEACCOUNTLOOKUP: {'name': 'Service Account Lookup pseudo-API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
|
|
265
|
+
SERVICEMANAGEMENT: {'name': 'Service Management API', 'version': 'v1', 'v2discovery': True},
|
|
266
|
+
SERVICEUSAGE: {'name': 'Service Usage API', 'version': 'v1', 'v2discovery': True},
|
|
267
|
+
SHEETS: {'name': 'Sheets API', 'version': 'v4', 'v2discovery': True},
|
|
268
|
+
SHEETSTD: {'name': 'Sheets API - todrive', 'version': 'v4', 'v2discovery': True, 'mappedAPI': SHEETS},
|
|
269
|
+
SITES: {'name': 'Sites API', 'version': 'v1', 'v2discovery': False},
|
|
270
|
+
SITEVERIFICATION: {'name': 'Site Verification API', 'version': 'v1', 'v2discovery': True},
|
|
271
|
+
STORAGE: {'name': 'Cloud Storage API', 'version': 'v1', 'v2discovery': True},
|
|
272
|
+
STORAGEREAD: {'name': 'Cloud Storage API - Read', 'version': 'v1', 'v2discovery': True, 'mappedAPI': STORAGE},
|
|
273
|
+
STORAGEWRITE: {'name': 'Cloud Storage API - Write', 'version': 'v1', 'v2discovery': True, 'mappedAPI': STORAGE},
|
|
274
|
+
TASKS: {'name': 'Tasks API', 'version': 'v1', 'v2discovery': True},
|
|
275
|
+
VAULT: {'name': 'Vault API', 'version': 'v1', 'v2discovery': True},
|
|
276
|
+
YOUTUBE: {'name': 'Youtube API', 'version': 'v3', 'v2discovery': True},
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
READONLY = ['readonly',]
|
|
280
|
+
|
|
281
|
+
_CLIENT_SCOPES = [
|
|
282
|
+
{'name': 'Calendar API',
|
|
283
|
+
'api': CALENDAR,
|
|
284
|
+
'subscopes': READONLY,
|
|
285
|
+
'scope': 'https://www.googleapis.com/auth/calendar'},
|
|
286
|
+
{'name': 'Chrome Browser Cloud Management API',
|
|
287
|
+
'api': CBCM,
|
|
288
|
+
'subscopes': READONLY,
|
|
289
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.device.chromebrowsers'},
|
|
290
|
+
{'name': 'Chrome Management API - read only',
|
|
291
|
+
'api': CHROMEMANAGEMENT,
|
|
292
|
+
'subscopes': [],
|
|
293
|
+
'scope': 'https://www.googleapis.com/auth/chrome.management.reports.readonly'},
|
|
294
|
+
{'name': 'Chrome Management API - AppDetails read only',
|
|
295
|
+
'api': CHROMEMANAGEMENT_APPDETAILS,
|
|
296
|
+
'subscopes': [],
|
|
297
|
+
'scope': 'https://www.googleapis.com/auth/chrome.management.appdetails.readonly'},
|
|
298
|
+
{'name': 'Chrome Management API - Profiles',
|
|
299
|
+
'api': CHROMEMANAGEMENT_CHROMEPROFILES,
|
|
300
|
+
'subscopes': READONLY,
|
|
301
|
+
'scope': 'https://www.googleapis.com/auth/chrome.management.profiles'},
|
|
302
|
+
{'name': 'Chrome Management API - Telemetry read only',
|
|
303
|
+
'api': CHROMEMANAGEMENT_TELEMETRY,
|
|
304
|
+
'subscopes': [],
|
|
305
|
+
'scope': 'https://www.googleapis.com/auth/chrome.management.telemetry.readonly'},
|
|
306
|
+
{'name': 'Chrome Policy API',
|
|
307
|
+
'api': CHROMEPOLICY,
|
|
308
|
+
'subscopes': READONLY,
|
|
309
|
+
'scope': 'https://www.googleapis.com/auth/chrome.management.policy'},
|
|
310
|
+
{'name': 'Chrome Printer Management API',
|
|
311
|
+
'api': PRINTERS,
|
|
312
|
+
'subscopes': READONLY,
|
|
313
|
+
'scope': 'https://www.googleapis.com/auth/admin.chrome.printers'},
|
|
314
|
+
{'name': 'Chrome Version History API',
|
|
315
|
+
'api': CHROMEVERSIONHISTORY,
|
|
316
|
+
'subscopes': [],
|
|
317
|
+
'scope': ''},
|
|
318
|
+
{'name': 'Classroom API - Courses',
|
|
319
|
+
'api': CLASSROOM,
|
|
320
|
+
'subscopes': READONLY,
|
|
321
|
+
'scope': 'https://www.googleapis.com/auth/classroom.courses'},
|
|
322
|
+
{'name': 'Classroom API - Course Announcements',
|
|
323
|
+
'api': CLASSROOM,
|
|
324
|
+
'subscopes': READONLY,
|
|
325
|
+
'scope': 'https://www.googleapis.com/auth/classroom.announcements'},
|
|
326
|
+
{'name': 'Classroom API - Course Topics',
|
|
327
|
+
'api': CLASSROOM,
|
|
328
|
+
'subscopes': READONLY,
|
|
329
|
+
'scope': 'https://www.googleapis.com/auth/classroom.topics'},
|
|
330
|
+
{'name': 'Classroom API - Course Work/Materials',
|
|
331
|
+
'api': CLASSROOM,
|
|
332
|
+
'subscopes': READONLY,
|
|
333
|
+
'scope': 'https://www.googleapis.com/auth/classroom.courseworkmaterials'},
|
|
334
|
+
{'name': 'Classroom API - Course Work/Submissions',
|
|
335
|
+
'api': CLASSROOM,
|
|
336
|
+
'subscopes': READONLY,
|
|
337
|
+
'scope': 'https://www.googleapis.com/auth/classroom.coursework.students'},
|
|
338
|
+
{'name': 'Classroom API - Student Guardians',
|
|
339
|
+
'api': CLASSROOM,
|
|
340
|
+
'subscopes': READONLY,
|
|
341
|
+
'scope': 'https://www.googleapis.com/auth/classroom.guardianlinks.students'},
|
|
342
|
+
{'name': 'Classroom API - Profile Emails',
|
|
343
|
+
'api': CLASSROOM,
|
|
344
|
+
'subscopes': [],
|
|
345
|
+
'scope': 'https://www.googleapis.com/auth/classroom.profile.emails'},
|
|
346
|
+
{'name': 'Classroom API - Profile Photos',
|
|
347
|
+
'api': CLASSROOM,
|
|
348
|
+
'subscopes': [],
|
|
349
|
+
'scope': 'https://www.googleapis.com/auth/classroom.profile.photos'},
|
|
350
|
+
{'name': 'Classroom API - Rosters',
|
|
351
|
+
'api': CLASSROOM,
|
|
352
|
+
'subscopes': READONLY,
|
|
353
|
+
'scope': 'https://www.googleapis.com/auth/classroom.rosters'},
|
|
354
|
+
{'name': 'Cloud Channel API',
|
|
355
|
+
'api': CLOUDCHANNEL,
|
|
356
|
+
'subscopes': READONLY,
|
|
357
|
+
'offByDefault': True,
|
|
358
|
+
'scope': 'https://www.googleapis.com/auth/apps.order'},
|
|
359
|
+
{'name': 'Cloud Identity Groups API',
|
|
360
|
+
'api': CLOUDIDENTITY_GROUPS,
|
|
361
|
+
'subscopes': READONLY,
|
|
362
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.groups'},
|
|
363
|
+
{'name': 'Cloud Identity Groups API Beta (Enables group locking/unlocking)',
|
|
364
|
+
'api': CLOUDIDENTITY_GROUPS_BETA,
|
|
365
|
+
'subscopes': [],
|
|
366
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.groups'},
|
|
367
|
+
{'name': 'Cloud Identity - Inbound SSO Settings',
|
|
368
|
+
'api': CLOUDIDENTITY_INBOUND_SSO,
|
|
369
|
+
'subscopes': READONLY,
|
|
370
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.inboundsso'},
|
|
371
|
+
{'name': 'Cloud Identity OrgUnits API',
|
|
372
|
+
'api': CLOUDIDENTITY_ORGUNITS_BETA,
|
|
373
|
+
'subscopes': READONLY,
|
|
374
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.orgunits'},
|
|
375
|
+
{'name': 'Cloud Identity - Policy',
|
|
376
|
+
'api': CLOUDIDENTITY_POLICY,
|
|
377
|
+
'subscopes': READONLY,
|
|
378
|
+
'roByDefault': True,
|
|
379
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.policies'
|
|
380
|
+
},
|
|
381
|
+
{'name': 'Cloud Identity User Invitations API',
|
|
382
|
+
'api': CLOUDIDENTITY_USERINVITATIONS,
|
|
383
|
+
'subscopes': READONLY,
|
|
384
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity.userinvitations'},
|
|
385
|
+
{'name': 'Cloud Storage API (Read Only, Vault/Takeout Download, Cloud Storage)',
|
|
386
|
+
'api': STORAGEREAD,
|
|
387
|
+
'subscopes': [],
|
|
388
|
+
'offByDefault': True,
|
|
389
|
+
'scope': STORAGE_READONLY_SCOPE},
|
|
390
|
+
{'name': 'Cloud Storage API (Read/Write, Vault/Takeout Copy/Download, Cloud Storage)',
|
|
391
|
+
'api': STORAGEWRITE,
|
|
392
|
+
'subscopes': [],
|
|
393
|
+
'offByDefault': True,
|
|
394
|
+
'scope': STORAGE_READWRITE_SCOPE},
|
|
395
|
+
{'name': 'Contacts API - Domain Shared Contacts and GAL',
|
|
396
|
+
'api': CONTACTS,
|
|
397
|
+
'subscopes': [],
|
|
398
|
+
'scope': 'https://www.google.com/m8/feeds'},
|
|
399
|
+
{'name': 'Contact Delegation API',
|
|
400
|
+
'api': CONTACTDELEGATION,
|
|
401
|
+
'subscopes': READONLY,
|
|
402
|
+
'scope': 'https://www.googleapis.com/auth/admin.contact.delegation'},
|
|
403
|
+
{'name': 'Data Transfer API',
|
|
404
|
+
'api': DATATRANSFER,
|
|
405
|
+
'subscopes': READONLY,
|
|
406
|
+
'scope': 'https://www.googleapis.com/auth/admin.datatransfer'},
|
|
407
|
+
{'name': 'Directory API - Chrome OS Devices',
|
|
408
|
+
'api': DIRECTORY,
|
|
409
|
+
'subscopes': READONLY,
|
|
410
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.device.chromeos'},
|
|
411
|
+
{'name': 'Directory API - Customers',
|
|
412
|
+
'api': DIRECTORY,
|
|
413
|
+
'subscopes': READONLY,
|
|
414
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.customer'},
|
|
415
|
+
{'name': 'Directory API - Domains',
|
|
416
|
+
'api': DIRECTORY,
|
|
417
|
+
'subscopes': READONLY,
|
|
418
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.domain'},
|
|
419
|
+
{'name': 'Directory API - Groups',
|
|
420
|
+
'api': DIRECTORY,
|
|
421
|
+
'subscopes': READONLY,
|
|
422
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.group'},
|
|
423
|
+
{'name': 'Directory API - Mobile Devices Directory',
|
|
424
|
+
'api': DIRECTORY,
|
|
425
|
+
'subscopes': ['readonly', 'action'],
|
|
426
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.device.mobile'},
|
|
427
|
+
{'name': 'Directory API - Organizational Units',
|
|
428
|
+
'api': DIRECTORY,
|
|
429
|
+
'subscopes': READONLY,
|
|
430
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.orgunit'},
|
|
431
|
+
{'name': 'Directory API - Resource Calendars',
|
|
432
|
+
'api': DIRECTORY,
|
|
433
|
+
'subscopes': READONLY,
|
|
434
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.resource.calendar'},
|
|
435
|
+
{'name': 'Directory API - Roles',
|
|
436
|
+
'api': DIRECTORY,
|
|
437
|
+
'subscopes': READONLY,
|
|
438
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.rolemanagement'},
|
|
439
|
+
{'name': 'Directory API - User Schemas',
|
|
440
|
+
'api': DIRECTORY,
|
|
441
|
+
'subscopes': READONLY,
|
|
442
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.userschema'},
|
|
443
|
+
{'name': 'Directory API - User Security',
|
|
444
|
+
'api': DIRECTORY,
|
|
445
|
+
'subscopes': [],
|
|
446
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.user.security'},
|
|
447
|
+
{'name': 'Directory API - Users',
|
|
448
|
+
'api': DIRECTORY,
|
|
449
|
+
'subscopes': READONLY,
|
|
450
|
+
'scope': 'https://www.googleapis.com/auth/admin.directory.user'},
|
|
451
|
+
{'name': 'Email Audit API',
|
|
452
|
+
'api': EMAIL_AUDIT,
|
|
453
|
+
'subscopes': [],
|
|
454
|
+
'offByDefault': True,
|
|
455
|
+
'scope': 'https://apps-apis.google.com/a/feeds/compliance/audit/'},
|
|
456
|
+
{'name': 'Groups Migration API',
|
|
457
|
+
'api': GROUPSMIGRATION,
|
|
458
|
+
'subscopes': [],
|
|
459
|
+
'scope': 'https://www.googleapis.com/auth/apps.groups.migration'},
|
|
460
|
+
{'name': 'Groups Settings API',
|
|
461
|
+
'api': GROUPSSETTINGS,
|
|
462
|
+
'subscopes': [],
|
|
463
|
+
'scope': 'https://www.googleapis.com/auth/apps.groups.settings'},
|
|
464
|
+
{'name': 'License Manager API',
|
|
465
|
+
'api': LICENSING,
|
|
466
|
+
'subscopes': [],
|
|
467
|
+
'scope': 'https://www.googleapis.com/auth/apps.licensing'},
|
|
468
|
+
{'name': 'People Directory API - read only',
|
|
469
|
+
'api': PEOPLE_DIRECTORY,
|
|
470
|
+
'subscopes': [],
|
|
471
|
+
'scope': 'https://www.googleapis.com/auth/directory.readonly'},
|
|
472
|
+
{'name': 'People API',
|
|
473
|
+
'api': PEOPLE,
|
|
474
|
+
'subscopes': READONLY,
|
|
475
|
+
'scope': PEOPLE_SCOPE},
|
|
476
|
+
{'name': 'Pub / Sub API',
|
|
477
|
+
'api': PUBSUB,
|
|
478
|
+
'subscopes': [],
|
|
479
|
+
'offByDefault': True,
|
|
480
|
+
'scope': 'https://www.googleapis.com/auth/pubsub'},
|
|
481
|
+
{'name': 'Reports API - Audit Reports',
|
|
482
|
+
'api': REPORTS,
|
|
483
|
+
'subscopes': [],
|
|
484
|
+
'scope': 'https://www.googleapis.com/auth/admin.reports.audit.readonly'},
|
|
485
|
+
{'name': 'Reports API - Usage Reports',
|
|
486
|
+
'api': REPORTS,
|
|
487
|
+
'subscopes': [],
|
|
488
|
+
'scope': 'https://www.googleapis.com/auth/admin.reports.usage.readonly'},
|
|
489
|
+
{'name': 'Reseller API',
|
|
490
|
+
'api': RESELLER,
|
|
491
|
+
'subscopes': [],
|
|
492
|
+
'offByDefault': True,
|
|
493
|
+
'scope': 'https://www.googleapis.com/auth/apps.order'},
|
|
494
|
+
{'name': 'Service Account Lookup pseudo-API',
|
|
495
|
+
'api': SERVICEACCOUNTLOOKUP,
|
|
496
|
+
'subscopes': [],
|
|
497
|
+
'scope': ''},
|
|
498
|
+
{'name': 'Site Verification API',
|
|
499
|
+
'api': SITEVERIFICATION,
|
|
500
|
+
'subscopes': [],
|
|
501
|
+
'offByDefault': True,
|
|
502
|
+
'scope': 'https://www.googleapis.com/auth/siteverification'},
|
|
503
|
+
{'name': 'Sites API',
|
|
504
|
+
'api': SITES,
|
|
505
|
+
'subscopes': [],
|
|
506
|
+
'offByDefault': True,
|
|
507
|
+
'scope': 'https://sites.google.com/feeds'},
|
|
508
|
+
{'name': 'Vault API',
|
|
509
|
+
'api': VAULT,
|
|
510
|
+
'subscopes': READONLY,
|
|
511
|
+
'scope': 'https://www.googleapis.com/auth/ediscovery'},
|
|
512
|
+
]
|
|
513
|
+
|
|
514
|
+
_TODRIVE_CLIENT_SCOPES = [
|
|
515
|
+
{'name': 'Drive API - todrive_clientaccess',
|
|
516
|
+
'api': DRIVE3,
|
|
517
|
+
'subscopes': [],
|
|
518
|
+
'scope': DRIVE_SCOPE},
|
|
519
|
+
{'name': 'Drive File API - todrive_clientaccess',
|
|
520
|
+
'api': DRIVE3,
|
|
521
|
+
'subscopes': [],
|
|
522
|
+
'scope': 'https://www.googleapis.com/auth/drive.file'},
|
|
523
|
+
{'name': 'Gmail API - todrive_clientaccess',
|
|
524
|
+
'api': GMAIL,
|
|
525
|
+
'subscopes': [],
|
|
526
|
+
'scope': GMAIL_SEND_SCOPE},
|
|
527
|
+
{'name': 'Sheets API - todrive_clientaccess',
|
|
528
|
+
'api': SHEETS,
|
|
529
|
+
'subscopes': [],
|
|
530
|
+
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
|
531
|
+
]
|
|
532
|
+
|
|
533
|
+
OAUTH2SA_SCOPES = 'us_scopes'
|
|
534
|
+
|
|
535
|
+
_SVCACCT_SCOPES = [
|
|
536
|
+
{'name': 'AlertCenter API',
|
|
537
|
+
'api': ALERTCENTER,
|
|
538
|
+
'subscopes': [],
|
|
539
|
+
'scope': 'https://www.googleapis.com/auth/apps.alerts'},
|
|
540
|
+
{'name': 'Analytics API - read only',
|
|
541
|
+
'api': ANALYTICS,
|
|
542
|
+
'subscopes': [],
|
|
543
|
+
'scope': 'https://www.googleapis.com/auth/analytics.readonly'},
|
|
544
|
+
{'name': 'Analytics Admin API - read only',
|
|
545
|
+
'api': ANALYTICS_ADMIN,
|
|
546
|
+
'subscopes': [],
|
|
547
|
+
'scope': 'https://www.googleapis.com/auth/analytics.readonly'},
|
|
548
|
+
{'name': 'Calendar API',
|
|
549
|
+
'api': CALENDAR,
|
|
550
|
+
'subscopes': READONLY,
|
|
551
|
+
'scope': 'https://www.googleapis.com/auth/calendar'},
|
|
552
|
+
{'name': 'Chat API - Memberships',
|
|
553
|
+
'api': CHAT_MEMBERSHIPS,
|
|
554
|
+
'subscopes': READONLY,
|
|
555
|
+
'scope': 'https://www.googleapis.com/auth/chat.memberships'},
|
|
556
|
+
{'name': 'Chat API - Memberships Admin',
|
|
557
|
+
'api': CHAT_MEMBERSHIPS_ADMIN,
|
|
558
|
+
'subscopes': READONLY,
|
|
559
|
+
'scope': 'https://www.googleapis.com/auth/chat.admin.memberships'},
|
|
560
|
+
{'name': 'Chat API - Messages',
|
|
561
|
+
'api': CHAT_MESSAGES,
|
|
562
|
+
'subscopes': READONLY,
|
|
563
|
+
'scope': 'https://www.googleapis.com/auth/chat.messages'},
|
|
564
|
+
{'name': 'Chat API - Spaces',
|
|
565
|
+
'api': CHAT_SPACES,
|
|
566
|
+
'subscopes': READONLY,
|
|
567
|
+
'scope': 'https://www.googleapis.com/auth/chat.spaces'},
|
|
568
|
+
{'name': 'Chat API - Spaces Admin',
|
|
569
|
+
'api': CHAT_SPACES_ADMIN,
|
|
570
|
+
'subscopes': READONLY,
|
|
571
|
+
'scope': 'https://www.googleapis.com/auth/chat.admin.spaces'},
|
|
572
|
+
{'name': 'Chat API - Spaces Delete',
|
|
573
|
+
'api': CHAT_SPACES_DELETE,
|
|
574
|
+
'subscopes': [],
|
|
575
|
+
'scope': 'https://www.googleapis.com/auth/chat.delete'},
|
|
576
|
+
{'name': 'Chat API - Spaces Delete Admin',
|
|
577
|
+
'api': CHAT_SPACES_DELETE_ADMIN,
|
|
578
|
+
'subscopes': [],
|
|
579
|
+
'scope': 'https://www.googleapis.com/auth/chat.admin.delete'},
|
|
580
|
+
{'name': 'Classroom API - Course Announcements',
|
|
581
|
+
'api': CLASSROOM,
|
|
582
|
+
'subscopes': READONLY,
|
|
583
|
+
'scope': 'https://www.googleapis.com/auth/classroom.announcements'},
|
|
584
|
+
{'name': 'Classroom API - Course Topics',
|
|
585
|
+
'api': CLASSROOM,
|
|
586
|
+
'subscopes': READONLY,
|
|
587
|
+
'scope': 'https://www.googleapis.com/auth/classroom.topics'},
|
|
588
|
+
{'name': 'Classroom API - Course Work/Materials',
|
|
589
|
+
'api': CLASSROOM,
|
|
590
|
+
'subscopes': READONLY,
|
|
591
|
+
'scope': 'https://www.googleapis.com/auth/classroom.courseworkmaterials'},
|
|
592
|
+
{'name': 'Classroom API - Course Work/Submissions',
|
|
593
|
+
'api': CLASSROOM,
|
|
594
|
+
'subscopes': READONLY,
|
|
595
|
+
'scope': 'https://www.googleapis.com/auth/classroom.coursework.students'},
|
|
596
|
+
{'name': 'Classroom API - Profile Emails',
|
|
597
|
+
'api': CLASSROOM,
|
|
598
|
+
'subscopes': [],
|
|
599
|
+
'scope': 'https://www.googleapis.com/auth/classroom.profile.emails'},
|
|
600
|
+
{'name': 'Classroom API - Profile Photos',
|
|
601
|
+
'api': CLASSROOM,
|
|
602
|
+
'subscopes': [],
|
|
603
|
+
'scope': 'https://www.googleapis.com/auth/classroom.profile.photos'},
|
|
604
|
+
{'name': 'Classroom API - Rosters',
|
|
605
|
+
'api': CLASSROOM,
|
|
606
|
+
'subscopes': READONLY,
|
|
607
|
+
'scope': 'https://www.googleapis.com/auth/classroom.rosters'},
|
|
608
|
+
{'name': 'Cloud Identity Devices API',
|
|
609
|
+
'api': CLOUDIDENTITY_DEVICES,
|
|
610
|
+
'subscopes': READONLY,
|
|
611
|
+
'scope': 'https://www.googleapis.com/auth/cloud-identity'},
|
|
612
|
+
# {'name': 'Cloud Identity User Invitations API',
|
|
613
|
+
# 'api': CLOUDIDENTITY_USERINVITATIONS,
|
|
614
|
+
# 'subscopes': READONLY,
|
|
615
|
+
# 'scope': 'https://www.googleapis.com/auth/cloud-identity'},
|
|
616
|
+
# {'name': 'Contacts API - Users',
|
|
617
|
+
# 'api': CONTACTS,
|
|
618
|
+
# 'subscopes': [],
|
|
619
|
+
# 'scope': 'https://www.google.com/m8/feeds'},
|
|
620
|
+
{'name': 'Drive API',
|
|
621
|
+
'api': DRIVE3,
|
|
622
|
+
'subscopes': READONLY,
|
|
623
|
+
'scope': DRIVE_SCOPE},
|
|
624
|
+
{'name': 'Drive Activity API v2 - must pair with Drive API',
|
|
625
|
+
'api': DRIVEACTIVITY,
|
|
626
|
+
'subscopes': [],
|
|
627
|
+
'scope': 'https://www.googleapis.com/auth/drive.activity'},
|
|
628
|
+
{'name': 'Drive Labels API - Admin',
|
|
629
|
+
'api': DRIVELABELS_ADMIN,
|
|
630
|
+
'subscopes': READONLY,
|
|
631
|
+
'scope': 'https://www.googleapis.com/auth/drive.admin.labels'},
|
|
632
|
+
{'name': 'Drive Labels API - User',
|
|
633
|
+
'api': DRIVELABELS_USER,
|
|
634
|
+
'subscopes': READONLY,
|
|
635
|
+
'scope': 'https://www.googleapis.com/auth/drive.labels'},
|
|
636
|
+
{'name': 'Docs API',
|
|
637
|
+
'api': DOCS,
|
|
638
|
+
'subscopes': READONLY,
|
|
639
|
+
'scope': 'https://www.googleapis.com/auth/documents'},
|
|
640
|
+
{'name': 'Forms API',
|
|
641
|
+
'api': FORMS,
|
|
642
|
+
'subscopes': [],
|
|
643
|
+
'scope': DRIVE_SCOPE},
|
|
644
|
+
{'name': 'Gmail API - Full Access (Labels, Messages)',
|
|
645
|
+
'api': GMAIL,
|
|
646
|
+
'subscopes': [],
|
|
647
|
+
'scope': 'https://mail.google.com/'},
|
|
648
|
+
{'name': 'Gmail API - Full Access (Labels, Messages) except delete message',
|
|
649
|
+
'api': GMAIL,
|
|
650
|
+
'subscopes': [],
|
|
651
|
+
'scope': 'https://www.googleapis.com/auth/gmail.modify'},
|
|
652
|
+
{'name': 'Gmail API - Basic Settings (Filters,IMAP, Language, POP, Vacation) - read/write, Sharing Settings (Delegates, Forwarding, SendAs) - read',
|
|
653
|
+
'api': GMAIL,
|
|
654
|
+
'subscopes': [],
|
|
655
|
+
'scope': 'https://www.googleapis.com/auth/gmail.settings.basic'},
|
|
656
|
+
{'name': 'Gmail API - Sharing Settings (Delegates, Forwarding, SendAs) - write',
|
|
657
|
+
'api': GMAIL,
|
|
658
|
+
'subscopes': [],
|
|
659
|
+
'scope': 'https://www.googleapis.com/auth/gmail.settings.sharing'},
|
|
660
|
+
{'name': 'Identity and Access Management API',
|
|
661
|
+
'api': IAM,
|
|
662
|
+
'subscopes': [],
|
|
663
|
+
'scope': CLOUD_PLATFORM_SCOPE},
|
|
664
|
+
{'name': 'Keep API',
|
|
665
|
+
'api': KEEP,
|
|
666
|
+
'subscopes': READONLY,
|
|
667
|
+
'scope': 'https://www.googleapis.com/auth/keep'},
|
|
668
|
+
{'name': 'Looker Studio API',
|
|
669
|
+
'api': LOOKERSTUDIO,
|
|
670
|
+
'subscopes': READONLY,
|
|
671
|
+
'scope': 'https://www.googleapis.com/auth/datastudio'},
|
|
672
|
+
{'name': 'Meet API',
|
|
673
|
+
'api': MEET,
|
|
674
|
+
'subscopes': READONLY,
|
|
675
|
+
'scope': 'https://www.googleapis.com/auth/meetings.space.created',
|
|
676
|
+
'roscope': 'https://www.googleapis.com/auth/meetings.space.readonly'},
|
|
677
|
+
{'name': 'OAuth2 API',
|
|
678
|
+
'api': OAUTH2,
|
|
679
|
+
'subscopes': [],
|
|
680
|
+
'scope': USERINFO_PROFILE_SCOPE},
|
|
681
|
+
{'name': 'People API',
|
|
682
|
+
'api': PEOPLE,
|
|
683
|
+
'subscopes': READONLY,
|
|
684
|
+
'scope': PEOPLE_SCOPE},
|
|
685
|
+
{'name': 'People Directory API - read only',
|
|
686
|
+
'api': PEOPLE_DIRECTORY,
|
|
687
|
+
'subscopes': [],
|
|
688
|
+
'scope': 'https://www.googleapis.com/auth/directory.readonly'},
|
|
689
|
+
{'name': 'People API - Other Contacts - read only',
|
|
690
|
+
'api': PEOPLE_OTHERCONTACTS,
|
|
691
|
+
'subscopes': [],
|
|
692
|
+
'scope': 'https://www.googleapis.com/auth/contacts.other.readonly'},
|
|
693
|
+
{'name': 'Sheets API',
|
|
694
|
+
'api': SHEETS,
|
|
695
|
+
'subscopes': READONLY,
|
|
696
|
+
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
|
697
|
+
{'name': 'Sites API',
|
|
698
|
+
'api': SITES,
|
|
699
|
+
'subscopes': [],
|
|
700
|
+
'scope': 'https://sites.google.com/feeds'},
|
|
701
|
+
{'name': 'Tasks API',
|
|
702
|
+
'api': TASKS,
|
|
703
|
+
'subscopes': READONLY,
|
|
704
|
+
'scope': 'https://www.googleapis.com/auth/tasks'},
|
|
705
|
+
{'name': 'Youtube API - read only',
|
|
706
|
+
'api': YOUTUBE,
|
|
707
|
+
'subscopes': [],
|
|
708
|
+
'offByDefault': True,
|
|
709
|
+
'scope': 'https://www.googleapis.com/auth/youtube.readonly'},
|
|
710
|
+
]
|
|
711
|
+
|
|
712
|
+
_SVCACCT_SPECIAL_SCOPES = [
|
|
713
|
+
{'name': 'Drive API - todrive',
|
|
714
|
+
'api': DRIVETD,
|
|
715
|
+
'subscopes': [],
|
|
716
|
+
'scope': DRIVE_SCOPE},
|
|
717
|
+
{'name': 'Gmail API - Full Access - read only',
|
|
718
|
+
'api': GMAIL,
|
|
719
|
+
'subscopes': [],
|
|
720
|
+
'offByDefault': True,
|
|
721
|
+
'scope': 'https://www.googleapis.com/auth/gmail.readonly'},
|
|
722
|
+
{'name': 'Gmail API - Send Messages - including todrive',
|
|
723
|
+
'api': GMAIL,
|
|
724
|
+
'subscopes': [],
|
|
725
|
+
'offByDefault': True,
|
|
726
|
+
'scope': GMAIL_SEND_SCOPE},
|
|
727
|
+
{'name': 'Sheets API - todrive',
|
|
728
|
+
'api': SHEETSTD,
|
|
729
|
+
'subscopes': [],
|
|
730
|
+
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
|
731
|
+
]
|
|
732
|
+
|
|
733
|
+
_USER_SVCACCT_ONLY_SCOPES = [
|
|
734
|
+
{'name': 'Groups Migration API',
|
|
735
|
+
'api': GROUPSMIGRATION,
|
|
736
|
+
'subscopes': [],
|
|
737
|
+
'scope': 'https://www.googleapis.com/auth/apps.groups.migration'},
|
|
738
|
+
]
|
|
739
|
+
|
|
740
|
+
DRIVE3_TO_DRIVE2_ABOUT_FIELDS_MAP = {
|
|
741
|
+
'displayName': 'name',
|
|
742
|
+
'limit': 'quotaBytesTotal',
|
|
743
|
+
'usage': 'quotaBytesUsedAggregate',
|
|
744
|
+
'usageInDrive': 'quotaBytesUsed',
|
|
745
|
+
'usageInDriveTrash': 'quotaBytesUsedInTrash',
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
DRIVE3_TO_DRIVE2_CAPABILITIES_FIELDS_MAP = {
|
|
749
|
+
'canComment': 'canComment',
|
|
750
|
+
'canReadRevisions': 'canReadRevisions',
|
|
751
|
+
'canCopy': 'copyable',
|
|
752
|
+
'canEdit': 'editable',
|
|
753
|
+
'canShare': 'shareable',
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
DRIVE3_TO_DRIVE2_CAPABILITIES_NAMES_MAP = {
|
|
757
|
+
'canChangeViewersCanCopyContent': 'canChangeRestrictedDownload',
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
DRIVE3_TO_DRIVE2_FILES_FIELDS_MAP = {
|
|
761
|
+
'allowFileDiscovery': 'withLink',
|
|
762
|
+
'createdTime': 'createdDate',
|
|
763
|
+
'expirationTime': 'expirationDate',
|
|
764
|
+
'modifiedByMe': 'modified',
|
|
765
|
+
'modifiedByMeTime': 'modifiedByMeDate',
|
|
766
|
+
'modifiedTime': 'modifiedDate',
|
|
767
|
+
'name': 'title',
|
|
768
|
+
'restrictionTime': 'restrictionDate',
|
|
769
|
+
'sharedWithMeTime': 'sharedWithMeDate',
|
|
770
|
+
'size': 'fileSize',
|
|
771
|
+
'trashedTime': 'trashedDate',
|
|
772
|
+
'viewedByMe': 'viewed',
|
|
773
|
+
'viewedByMeTime': 'lastViewedByMeDate',
|
|
774
|
+
'webViewLink': 'alternateLink',
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
DRIVE3_TO_DRIVE2_LABELS_MAP = {
|
|
778
|
+
'modifiedByMe': 'modified',
|
|
779
|
+
'starred': 'starred',
|
|
780
|
+
'trashed': 'trashed',
|
|
781
|
+
'viewedByMe': 'viewed',
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
DRIVE3_TO_DRIVE2_REVISIONS_FIELDS_MAP = {
|
|
785
|
+
'modifiedTime': 'modifiedDate',
|
|
786
|
+
'keepForever': 'pinned',
|
|
787
|
+
'size': 'fileSize',
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
def getAPIName(api):
|
|
791
|
+
return _INFO[api]['name']
|
|
792
|
+
|
|
793
|
+
def getVersion(api):
|
|
794
|
+
version = _INFO[api]['version']
|
|
795
|
+
v2discovery = _INFO[api]['v2discovery']
|
|
796
|
+
api = _INFO[api].get('mappedAPI', api)
|
|
797
|
+
return (api, version, v2discovery)
|
|
798
|
+
|
|
799
|
+
def getClientScopesSet(api):
|
|
800
|
+
return {scope['scope'] for scope in _CLIENT_SCOPES if scope['api'] == api}
|
|
801
|
+
|
|
802
|
+
def getClientScopesList(todriveClientAccess):
|
|
803
|
+
caScopes = _CLIENT_SCOPES[:]
|
|
804
|
+
if todriveClientAccess:
|
|
805
|
+
caScopes.extend(_TODRIVE_CLIENT_SCOPES)
|
|
806
|
+
return sorted(caScopes, key=lambda k: k['name'])
|
|
807
|
+
|
|
808
|
+
def getClientScopesURLs(todriveClientAccess):
|
|
809
|
+
caScopes = _CLIENT_SCOPES[:]
|
|
810
|
+
if todriveClientAccess:
|
|
811
|
+
caScopes.extend(_TODRIVE_CLIENT_SCOPES)
|
|
812
|
+
return sorted({scope['scope'] for scope in _CLIENT_SCOPES})
|
|
813
|
+
|
|
814
|
+
def getSvcAcctScopeAPI(uscope):
|
|
815
|
+
for scope in _SVCACCT_SCOPES:
|
|
816
|
+
if uscope == scope['scope'] or (uscope.endswith('.readonly') and 'readonly' in scope['subscopes']):
|
|
817
|
+
return scope['api']
|
|
818
|
+
return None
|
|
819
|
+
|
|
820
|
+
def getSvcAcctScopes(userServiceAccountAccessOnly, svcAcctSpecialScopes):
|
|
821
|
+
saScopes = [scope['scope'] for scope in _SVCACCT_SCOPES]
|
|
822
|
+
if userServiceAccountAccessOnly:
|
|
823
|
+
saScopes.extend([scope['scope'] for scope in _USER_SVCACCT_ONLY_SCOPES])
|
|
824
|
+
if svcAcctSpecialScopes:
|
|
825
|
+
saScopes.extend([scope['scope'] for scope in _SVCACCT_SPECIAL_SCOPES])
|
|
826
|
+
return saScopes
|
|
827
|
+
|
|
828
|
+
def getSvcAcctScopesList(userServiceAccountAccessOnly, svcAcctSpecialScopes):
|
|
829
|
+
saScopes = _SVCACCT_SCOPES[:]
|
|
830
|
+
if userServiceAccountAccessOnly:
|
|
831
|
+
saScopes.extend(_USER_SVCACCT_ONLY_SCOPES)
|
|
832
|
+
if svcAcctSpecialScopes:
|
|
833
|
+
saScopes.extend(_SVCACCT_SPECIAL_SCOPES)
|
|
834
|
+
return sorted(saScopes, key=lambda k: k['name'])
|
|
835
|
+
|
|
836
|
+
def hasLocalJSON(api):
|
|
837
|
+
return _INFO[api].get('localjson', False)
|