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.

Files changed (72) hide show
  1. gam/__init__.py +77555 -0
  2. gam/__main__.py +40 -0
  3. gam/atom/__init__.py +1460 -0
  4. gam/atom/auth.py +41 -0
  5. gam/atom/client.py +214 -0
  6. gam/atom/core.py +535 -0
  7. gam/atom/data.py +327 -0
  8. gam/atom/http.py +354 -0
  9. gam/atom/http_core.py +599 -0
  10. gam/atom/http_interface.py +144 -0
  11. gam/atom/mock_http.py +123 -0
  12. gam/atom/mock_http_core.py +313 -0
  13. gam/atom/mock_service.py +235 -0
  14. gam/atom/service.py +723 -0
  15. gam/atom/token_store.py +105 -0
  16. gam/atom/url.py +130 -0
  17. gam/cacerts.pem +1130 -0
  18. gam/cbcm-v1.1beta1.json +593 -0
  19. gam/contactdelegation-v1.json +249 -0
  20. gam/datastudio-v1.json +486 -0
  21. gam/gamlib/__init__.py +17 -0
  22. gam/gamlib/glaction.py +308 -0
  23. gam/gamlib/glapi.py +837 -0
  24. gam/gamlib/glcfg.py +616 -0
  25. gam/gamlib/glclargs.py +1184 -0
  26. gam/gamlib/glentity.py +831 -0
  27. gam/gamlib/glgapi.py +817 -0
  28. gam/gamlib/glgdata.py +98 -0
  29. gam/gamlib/glglobals.py +307 -0
  30. gam/gamlib/glindent.py +46 -0
  31. gam/gamlib/glmsgs.py +547 -0
  32. gam/gamlib/glskus.py +246 -0
  33. gam/gamlib/gluprop.py +279 -0
  34. gam/gamlib/glverlibs.py +33 -0
  35. gam/gamlib/yubikey.py +202 -0
  36. gam/gdata/__init__.py +825 -0
  37. gam/gdata/alt/__init__.py +20 -0
  38. gam/gdata/alt/app_engine.py +101 -0
  39. gam/gdata/alt/appengine.py +321 -0
  40. gam/gdata/apps/__init__.py +526 -0
  41. gam/gdata/apps/audit/__init__.py +1 -0
  42. gam/gdata/apps/audit/service.py +278 -0
  43. gam/gdata/apps/contacts/__init__.py +874 -0
  44. gam/gdata/apps/contacts/service.py +355 -0
  45. gam/gdata/apps/service.py +544 -0
  46. gam/gdata/apps/sites/__init__.py +283 -0
  47. gam/gdata/apps/sites/service.py +246 -0
  48. gam/gdata/service.py +1714 -0
  49. gam/gdata/urlfetch.py +247 -0
  50. gam/googleapiclient/__init__.py +27 -0
  51. gam/googleapiclient/_auth.py +167 -0
  52. gam/googleapiclient/_helpers.py +207 -0
  53. gam/googleapiclient/channel.py +315 -0
  54. gam/googleapiclient/discovery.py +1662 -0
  55. gam/googleapiclient/discovery_cache/__init__.py +78 -0
  56. gam/googleapiclient/discovery_cache/appengine_memcache.py +55 -0
  57. gam/googleapiclient/discovery_cache/base.py +46 -0
  58. gam/googleapiclient/discovery_cache/file_cache.py +145 -0
  59. gam/googleapiclient/errors.py +197 -0
  60. gam/googleapiclient/http.py +1962 -0
  61. gam/googleapiclient/mimeparse.py +183 -0
  62. gam/googleapiclient/model.py +429 -0
  63. gam/googleapiclient/schema.py +317 -0
  64. gam/googleapiclient/version.py +15 -0
  65. gam/iso8601/__init__.py +28 -0
  66. gam/iso8601/iso8601.py +160 -0
  67. gam/serviceaccountlookup-v1.json +141 -0
  68. gam/six.py +982 -0
  69. gam7-7.3.4.dist-info/METADATA +69 -0
  70. gam7-7.3.4.dist-info/RECORD +72 -0
  71. gam7-7.3.4.dist-info/WHEEL +4 -0
  72. gam7-7.3.4.dist-info/licenses/LICENSE +201 -0
gam/gamlib/glaction.py ADDED
@@ -0,0 +1,308 @@
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
+ """GAM action processing
20
+
21
+ """
22
+
23
+ class GamAction():
24
+
25
+ # Keys into NAMES; arbitrary values but must be unique
26
+ ACCEPT = 'acpt'
27
+ ADD = 'add '
28
+ ADD_PREVIEW = 'addp'
29
+ APPEND = 'apnd'
30
+ APPROVE = 'aprv'
31
+ ARCHIVE = 'arch'
32
+ BACKUP = 'back'
33
+ BLOCK = 'blok'
34
+ CANCEL = 'canc'
35
+ CANCEL_WIPE = 'canw'
36
+ CHECK = 'chek'
37
+ CLAIM = 'clai'
38
+ CLAIM_OWNERSHIP = 'clow'
39
+ CLEAR = 'clea'
40
+ CLOSE = 'clos'
41
+ COLLECT = 'coll'
42
+ COMMENT = 'comm'
43
+ COPY = 'copy'
44
+ COPY_MERGE = 'copm'
45
+ CREATE = 'crea'
46
+ CREATE_PREVIEW = 'crep'
47
+ CREATE_SHORTCUT = 'crsc'
48
+ DEDUP = 'dedu'
49
+ DELETE = 'dele'
50
+ DELETE_EMPTY = 'delm'
51
+ DELETE_PREVIEW = 'delp'
52
+ DELETE_SHORTCUT = 'desc'
53
+ DEPROVISION = 'depr'
54
+ DISABLE = 'disa'
55
+ DOWNLOAD = 'down'
56
+ DRAFT = 'draf'
57
+ EMPTY = 'empt'
58
+ ENABLE = 'enbl'
59
+ END = 'end '
60
+ EXISTS = 'exis'
61
+ EXPORT = 'expo'
62
+ EXTRACT = 'extr'
63
+ GET_COMMAND_RESULT = 'gtcr'
64
+ FETCH = 'fetc'
65
+ FORWARD = 'forw'
66
+ HIDE = 'hide'
67
+ IMPORT = 'impo'
68
+ INFO = 'info'
69
+ INITIALIZE = 'init'
70
+ INSERT = 'insr'
71
+ INVALIDATE = 'inva'
72
+ ISSUE_COMMAND = 'isco'
73
+ LIST = 'list'
74
+ LOOKUP = 'look'
75
+ MERGE = 'merg'
76
+ MODIFY = 'modi'
77
+ MOVE = 'move'
78
+ MOVE_MERGE = 'movm'
79
+ NOACTION = 'noac'
80
+ NOACTION_PREVIEW = 'noap'
81
+ OBLITERATE = 'obli'
82
+ PERFORM = 'perf'
83
+ PRE_PROVISIONED_DISABLE ='ppdi'
84
+ PRE_PROVISIONED_REENABLE ='ppre'
85
+ PRINT = 'prin'
86
+ PROCESS = 'proc'
87
+ PROCESS_PREVIEW = 'prop'
88
+ PURGE = 'purg'
89
+ RECREATE = 'recr'
90
+ REENABLE = 'reen'
91
+ REFRESH = 'refr'
92
+ RELABEL = 'rela'
93
+ REMOVE = 'remo'
94
+ REMOVE_PREVIEW = 'remp'
95
+ RENAME = 'rena'
96
+ REOPEN = 'reop'
97
+ REPLACE = 'repl'
98
+ REPLACE_DOMAIN = 'repd'
99
+ REPORT = 'repo'
100
+ RESET_YUBIKEY_PIV = 'rpiv'
101
+ RESPOND = 'resp'
102
+ RESTORE = 'rest'
103
+ RESUBMIT = 'res'
104
+ RETAIN = 'reta'
105
+ RETRIEVE_DATA = 'retd'
106
+ REVOKE = 'revo'
107
+ SAVE = 'save'
108
+ SEND = 'send'
109
+ SENDEMAIL = 'snem'
110
+ SET = 'set '
111
+ SETUP = 'setu'
112
+ SHARE = 'shar'
113
+ SHOW = 'show'
114
+ SIGNOUT = 'siou'
115
+ SKIP = 'skip'
116
+ SPAM = 'spam'
117
+ SUBMIT = 'subm'
118
+ SUSPEND = 'susp'
119
+ SYNC = 'sync'
120
+ TRANSFER = 'tran'
121
+ TRANSFER_OWNERSHIP = 'trow'
122
+ TRASH = 'tras'
123
+ TURNOFF2SV = 'to2s'
124
+ UNDELETE = 'unde'
125
+ UNHIDE = 'unhi'
126
+ UNSUSPEND = 'unsu'
127
+ UNTRASH = 'untr'
128
+ UPDATE = 'upda'
129
+ UPDATE_MOVE = 'upmo'
130
+ UPDATE_OWNER = 'updo'
131
+ UPDATE_PREVIEW = 'updp'
132
+ UPLOAD = 'uplo'
133
+ UNZIP = 'unzi'
134
+ USE = 'use '
135
+ VERIFY = 'vrfy'
136
+ WAITFORMAILBOX = 'wamb'
137
+ WATCH = 'watc'
138
+ WIPE = 'wipe'
139
+ WIPE_PREVIEW = 'wipp'
140
+ # Usage:
141
+ # ACTION_NAMES[1] n Items - Delete 10 Users
142
+ # Item xxx ACTION_NAMES[0] - User xxx Deleted
143
+ # These values can be translated into other languages
144
+ _NAMES = {
145
+ ACCEPT: ['Accepted', 'Accept'],
146
+ ADD: ['Added', 'Add'],
147
+ ADD_PREVIEW: ['Added (Preview)', 'Add (Preview)'],
148
+ APPEND: ['Appended', 'Append'],
149
+ APPROVE: ['Approved', 'Approve'],
150
+ ARCHIVE: ['Archived', 'Archive'],
151
+ BACKUP: ['Backed up', 'Backup'],
152
+ BLOCK: ['Blocked', 'Block'],
153
+ CANCEL: ['Cancelled', 'Cancel'],
154
+ CANCEL_WIPE: ['Wipe Cancelled', 'Cancel Wipe'],
155
+ CHECK: ['Checked', 'Check'],
156
+ CLAIM: ['Claimed', 'Claim'],
157
+ CLAIM_OWNERSHIP: ['Ownership Claimed', 'Claim Ownership'],
158
+ CLEAR: ['Cleared', 'Clear'],
159
+ CLOSE: ['Closed', 'Close'],
160
+ COLLECT: ['Collected', 'Collect'],
161
+ COMMENT: ['Commented', 'Comment'],
162
+ COPY: ['Copied', 'Copy'],
163
+ COPY_MERGE: ['Copied(Merge)', 'Copy(Merge)'],
164
+ CREATE: ['Created', 'Create'],
165
+ CREATE_PREVIEW: ['Created (Preview)', 'Create (Preview)'],
166
+ CREATE_SHORTCUT: ['Created Shortcut', 'Create Shortcut'],
167
+ DEDUP: ['Duplicates Deleted', 'Delete Duplicates'],
168
+ DELETE: ['Deleted', 'Delete'],
169
+ DELETE_EMPTY: ['Deleted', 'Delete Empty'],
170
+ DELETE_PREVIEW: ['Deleted (Preview)', 'Delete (Preview)'],
171
+ DELETE_SHORTCUT: ['Deleted Shortcut', 'Delete Shortcut'],
172
+ DEPROVISION: ['Deprovisioned', 'Deprovision'],
173
+ DISABLE: ['Disabled', 'Disable'],
174
+ DOWNLOAD: ['Downloaded', 'Download'],
175
+ DRAFT: ['Drafted', 'Draft'],
176
+ EMPTY: ['Emptied', 'Empty'],
177
+ ENABLE: ['Enabled', 'Enable'],
178
+ END: ['Ended', 'End'],
179
+ EXISTS: ['Exists', 'Exists'],
180
+ EXPORT: ['Exported', 'Export'],
181
+ EXTRACT: ['Extracted', 'Extract'],
182
+ FORWARD: ['Forwarded', 'Forward'],
183
+ GET_COMMAND_RESULT: ['Got Command Result', 'Get Command Result'],
184
+ HIDE: ['Hidden', 'Hide'],
185
+ IMPORT: ['Imported', 'Import'],
186
+ INFO: ['Shown', 'Show Info'],
187
+ INITIALIZE: ['Initialized', 'Initialize'],
188
+ INSERT: ['Inserted', 'Insert'],
189
+ INVALIDATE: ['Invalidated', 'Invalidate'],
190
+ ISSUE_COMMAND: ['Command Issued', 'Issue Command'],
191
+ LIST: ['Listed', 'List'],
192
+ LOOKUP: ['Lookedup', 'Lookup'],
193
+ MERGE: ['Merged', 'Merge'],
194
+ MODIFY: ['Modified', 'Modify'],
195
+ MOVE: ['Moved', 'Move'],
196
+ MOVE_MERGE: ['Moved(Merge)', 'Move(Merge)'],
197
+ NOACTION: ['No Action', 'No Action'],
198
+ NOACTION_PREVIEW: ['No Action (Preview)', 'No Action (Preview)'],
199
+ OBLITERATE: ['Obliterated', 'Obliterate'],
200
+ PERFORM: ['Action Performed', 'Perform Action'],
201
+ PRE_PROVISIONED_DISABLE: ['PreProvisioned Disabled', 'PreProvisioned Disable'],
202
+ PRE_PROVISIONED_REENABLE: ['PreProvisioned Reenabled', 'PreProvisioned Reenable'],
203
+ PRINT: ['Printed', 'Print'],
204
+ PROCESS: ['Processed', 'Process'],
205
+ PROCESS_PREVIEW: ['Processed (Preview)', 'Process (Preview)'],
206
+ PURGE: ['Purged', 'Purge'],
207
+ RECREATE: ['Recreated', 'Recreate'],
208
+ REENABLE: ['Reenabled', 'Reenable'],
209
+ REFRESH: ['Refreshed', 'Refresh'],
210
+ RELABEL: ['Relabeled', 'Relabel'],
211
+ REMOVE: ['Removed', 'Remove'],
212
+ REMOVE_PREVIEW: ['Removed (Preview)', 'Remove (Preview)'],
213
+ RENAME: ['Renamed', 'Rename'],
214
+ REOPEN: ['Reopened', 'Reopen'],
215
+ REPLACE: ['Replaced', 'Replace'],
216
+ REPLACE_DOMAIN: ['Domain Replaced', 'Replace Domain'],
217
+ REPORT: ['Reported', 'Report'],
218
+ RESET_YUBIKEY_PIV: ['Yubikey PIV Reset', 'Reset Yubikey PIV'],
219
+ RESPOND: ['Responded', 'Respond'],
220
+ RESTORE: ['Restored', 'Restore'],
221
+ RESUBMIT: ['Resubmitted', 'Resubmit'],
222
+ RETAIN: ['Retained', 'Retain'],
223
+ RETRIEVE_DATA: ['Data Retrieved', 'Retrieve Data'],
224
+ REVOKE: ['Revoked', 'Revoke'],
225
+ SAVE: ['Saved', 'Save'],
226
+ SEND: ['Sent', 'Send'],
227
+ SENDEMAIL: ['Email Sent', 'Send Email'],
228
+ SET: ['Set', 'Set'],
229
+ SETUP: ['Set Up', 'Set Up'],
230
+ SHARE: ['Shared', 'Share'],
231
+ SHOW: ['Shown', 'Show'],
232
+ SIGNOUT: ['Signed Out', 'Signout'],
233
+ SKIP: ['Skipped', 'Skip'],
234
+ SPAM: ['Marked as Spam', 'Mark as Spam'],
235
+ SUBMIT: ['Submitted', 'Submit'],
236
+ SUSPEND: ['Suspended', 'Suspend'],
237
+ SYNC: ['Synced', 'Sync'],
238
+ TRANSFER: ['Transferred', 'Transfer'],
239
+ TRANSFER_OWNERSHIP: ['Ownership Transferred', 'Transfer Ownership'],
240
+ TRASH: ['Trashed', 'Trash'],
241
+ TURNOFF2SV: ['2-Step Verification Turned Off', 'Turn Off 2-Step Verification'],
242
+ UNDELETE: ['Undeleted', 'Undelete'],
243
+ UNHIDE: ['Unhidden', 'Unhide'],
244
+ UNSUSPEND: ['Unsuspended', 'Unsuspend'],
245
+ UNTRASH: ['Untrashed', 'Untrash'],
246
+ UNZIP: ['Unzipped', 'Unzip'],
247
+ UPDATE: ['Updated', 'Update'],
248
+ UPDATE_MOVE: ['Updated/Moved', 'Update/Move'],
249
+ UPDATE_OWNER: ['Updated to Owner', 'Update to Owner'],
250
+ UPDATE_PREVIEW: ['Updated (Preview)', 'Update (Preview)'],
251
+ UPLOAD: ['Uploaded', 'Upload'],
252
+ USE: ['Used', 'Use'],
253
+ VERIFY: ['Verified', 'Verify'],
254
+ WAITFORMAILBOX: ['Mailbox is Setup', 'Check Mailbox is Setup'],
255
+ WATCH: ['Watched', 'Watch'],
256
+ WIPE: ['Wiped', 'Wipe'],
257
+ WIPE_PREVIEW: ['Wiped (Preview)', 'Wipe (Preview)'],
258
+ }
259
+ #
260
+ MODIFIER_CONTENTS_WITH = 'contents with'
261
+ MODIFIER_FOR = 'for'
262
+ MODIFIER_FROM = 'from'
263
+ MODIFIER_IN = 'in'
264
+ MODIFIER_INTO = 'into'
265
+ MODIFIER_PREVIOUSLY_IN = 'previously in'
266
+ MODIFIER_TO = 'to'
267
+ MODIFIER_WITH_COTEACHER_OWNER = 'with co-teacher as owner'
268
+ MODIFIER_WITH_NEW_TEACHER_OWNER = 'with new teacher as owner'
269
+ MODIFIER_WITH_CURRENT_OWNER = 'with current owner'
270
+ MODIFIER_WITH = 'with'
271
+ MODIFIER_WITH_CONTENT_FROM = 'with content from'
272
+ PREFIX_NOT = 'Not'
273
+ PREVIEW = 'Preview'
274
+ SUCCESS = 'Success'
275
+ SUFFIX_FAILED = 'Failed'
276
+
277
+ def __init__(self):
278
+ self.action = None
279
+
280
+ def Set(self, action):
281
+ self.action = action
282
+
283
+ def Get(self):
284
+ return self.action
285
+
286
+ def ToPerform(self):
287
+ return self._NAMES[self.action][1]
288
+
289
+ def Performed(self):
290
+ return self._NAMES[self.action][0]
291
+
292
+ def Failed(self):
293
+ return f'{self._NAMES[self.action][1]} {self.SUFFIX_FAILED}'
294
+
295
+ def NotPerformed(self):
296
+ actionWords = self._NAMES[self.action][0].split(' ')
297
+ if len(actionWords) != 2:
298
+ return f'{self.PREFIX_NOT} {self._NAMES[self.action][0]}'
299
+ return f'{actionWords[0]} {self.PREFIX_NOT} {actionWords[1]}'
300
+
301
+ def PerformedName(self, action):
302
+ return self._NAMES[action][0]
303
+
304
+ def ToPerformName(self, action):
305
+ return self._NAMES[action][1]
306
+
307
+ def csvFormat(self):
308
+ return self.action == self.PRINT