pyxetabase 3.1.0.dev0__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 pyxetabase might be problematic. Click here for more details.

Files changed (63) hide show
  1. pyopencga/__init__.py +0 -0
  2. pyopencga/commons.py +347 -0
  3. pyopencga/exceptions.py +8 -0
  4. pyopencga/opencga_client.py +334 -0
  5. pyopencga/opencga_config.py +160 -0
  6. pyopencga/rest_clients/__init__.py +0 -0
  7. pyopencga/rest_clients/_parent_rest_clients.py +110 -0
  8. pyopencga/rest_clients/admin_client.py +173 -0
  9. pyopencga/rest_clients/alignment_client.py +373 -0
  10. pyopencga/rest_clients/clinical_analysis_client.py +1279 -0
  11. pyopencga/rest_clients/cohort_client.py +338 -0
  12. pyopencga/rest_clients/disease_panel_client.py +352 -0
  13. pyopencga/rest_clients/family_client.py +355 -0
  14. pyopencga/rest_clients/file_client.py +698 -0
  15. pyopencga/rest_clients/ga4gh_client.py +86 -0
  16. pyopencga/rest_clients/individual_client.py +435 -0
  17. pyopencga/rest_clients/job_client.py +415 -0
  18. pyopencga/rest_clients/meta_client.py +83 -0
  19. pyopencga/rest_clients/organization_client.py +206 -0
  20. pyopencga/rest_clients/project_client.py +128 -0
  21. pyopencga/rest_clients/sample_client.py +446 -0
  22. pyopencga/rest_clients/study_client.py +433 -0
  23. pyopencga/rest_clients/user_client.py +192 -0
  24. pyopencga/rest_clients/variant_client.py +1378 -0
  25. pyopencga/rest_clients/variant_operation_client.py +719 -0
  26. pyopencga/rest_clients/workflow_client.py +263 -0
  27. pyopencga/rest_response.py +220 -0
  28. pyopencga/retry.py +57 -0
  29. pyxetabase/__init__.py +0 -0
  30. pyxetabase/commons.py +347 -0
  31. pyxetabase/exceptions.py +8 -0
  32. pyxetabase/opencga_client.py +344 -0
  33. pyxetabase/opencga_config.py +160 -0
  34. pyxetabase/rest_clients/__init__.py +0 -0
  35. pyxetabase/rest_clients/_parent_rest_clients.py +110 -0
  36. pyxetabase/rest_clients/admin_client.py +173 -0
  37. pyxetabase/rest_clients/alignment_client.py +373 -0
  38. pyxetabase/rest_clients/clinical_analysis_client.py +1273 -0
  39. pyxetabase/rest_clients/cohort_client.py +338 -0
  40. pyxetabase/rest_clients/cvdb_client.py +2258 -0
  41. pyxetabase/rest_clients/disease_panel_client.py +352 -0
  42. pyxetabase/rest_clients/family_client.py +355 -0
  43. pyxetabase/rest_clients/federation_client.py +133 -0
  44. pyxetabase/rest_clients/file_client.py +698 -0
  45. pyxetabase/rest_clients/ga4gh_client.py +86 -0
  46. pyxetabase/rest_clients/individual_client.py +435 -0
  47. pyxetabase/rest_clients/job_client.py +415 -0
  48. pyxetabase/rest_clients/meta_client.py +83 -0
  49. pyxetabase/rest_clients/organization_client.py +206 -0
  50. pyxetabase/rest_clients/project_client.py +128 -0
  51. pyxetabase/rest_clients/sample_client.py +446 -0
  52. pyxetabase/rest_clients/study_client.py +433 -0
  53. pyxetabase/rest_clients/user_client.py +212 -0
  54. pyxetabase/rest_clients/variant_client.py +1378 -0
  55. pyxetabase/rest_clients/variant_operation_client.py +719 -0
  56. pyxetabase/rest_clients/workflow_client.py +263 -0
  57. pyxetabase/rest_response.py +220 -0
  58. pyxetabase/retry.py +57 -0
  59. pyxetabase-3.1.0.dev0.dist-info/METADATA +159 -0
  60. pyxetabase-3.1.0.dev0.dist-info/RECORD +63 -0
  61. pyxetabase-3.1.0.dev0.dist-info/WHEEL +5 -0
  62. pyxetabase-3.1.0.dev0.dist-info/licenses/LICENSE +202 -0
  63. pyxetabase-3.1.0.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,433 @@
1
+ """
2
+ WARNING: AUTOGENERATED CODE
3
+
4
+ This code was generated by a tool.
5
+
6
+ Manual changes to this file may cause unexpected behavior in your application.
7
+ Manual changes to this file will be overwritten if the code is regenerated.
8
+ """
9
+
10
+ from pyopencga.rest_clients._parent_rest_clients import _ParentRestClient
11
+
12
+
13
+ class Study(_ParentRestClient):
14
+ """
15
+ This class contains methods for the 'Studies' webservices
16
+ PATH: /{apiVersion}/studies
17
+ """
18
+
19
+ def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
20
+ super(Study, self).__init__(configuration, token, login_handler, *args, **kwargs)
21
+
22
+ def update_acl(self, members, action, data=None, **options):
23
+ """
24
+ Update the set of permissions granted for the member.
25
+ PATH: /{apiVersion}/studies/acl/{members}/update
26
+
27
+ :param dict data: JSON containing the parameters to modify ACLs.
28
+ 'template' could be either 'admin', 'analyst' or 'view_only'.
29
+ (REQUIRED)
30
+ :param str action: Action to be performed [ADD, SET, REMOVE or RESET].
31
+ Allowed values: ['SET ADD REMOVE RESET'] (REQUIRED)
32
+ :param str members: Comma separated list of user or group ids.
33
+ (REQUIRED)
34
+ """
35
+
36
+ options['action'] = action
37
+ return self._post(category='studies', resource='update', subcategory='acl', second_query_id=members, data=data, **options)
38
+
39
+ def create(self, data=None, **options):
40
+ """
41
+ Create a new study.
42
+ PATH: /{apiVersion}/studies/create
43
+
44
+ :param dict data: study. (REQUIRED)
45
+ :param str include: Fields included in the response, whole JSON path
46
+ must be provided.
47
+ :param str exclude: Fields excluded in the response, whole JSON path
48
+ must be provided.
49
+ :param str project: Project [organization@]project where project can
50
+ be either the ID or the alias.
51
+ :param bool include_result: Flag indicating to include the created or
52
+ updated document result in the response.
53
+ """
54
+
55
+ return self._post(category='studies', resource='create', data=data, **options)
56
+
57
+ def search(self, project, **options):
58
+ """
59
+ Search studies.
60
+ PATH: /{apiVersion}/studies/search
61
+
62
+ :param str project: Project [organization@]project where project can
63
+ be either the ID or the alias. (REQUIRED)
64
+ :param str include: Fields included in the response, whole JSON path
65
+ must be provided.
66
+ :param str exclude: Fields excluded in the response, whole JSON path
67
+ must be provided.
68
+ :param int limit: Number of results to be returned.
69
+ :param int skip: Number of results to skip.
70
+ :param bool count: Get the total number of results matching the query.
71
+ Deactivated by default.
72
+ :param str name: Study name.
73
+ :param str id: Study ID.
74
+ :param str alias: Study alias.
75
+ :param str fqn: Study full qualified name.
76
+ :param str creation_date: Creation date. Format: yyyyMMddHHmmss.
77
+ Examples: >2018, 2017-2018, <201805.
78
+ :param str modification_date: Modification date. Format:
79
+ yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
80
+ :param str internal_status: Filter by internal status.
81
+ :param str status: Filter by status.
82
+ :param str attributes: Attributes.
83
+ :param str release: Release value.
84
+ """
85
+
86
+ options['project'] = project
87
+ return self._get(category='studies', resource='search', **options)
88
+
89
+ def acl(self, studies, **options):
90
+ """
91
+ Return the acl of the study. If member is provided, it will only
92
+ return the acl for the member.
93
+ PATH: /{apiVersion}/studies/{studies}/acl
94
+
95
+ :param str studies: Comma separated list of Studies
96
+ [[organization@]project:]study where study and project can be
97
+ either the ID or UUID up to a maximum of 100. (REQUIRED)
98
+ :param str member: User or group id.
99
+ :param bool silent: Boolean to retrieve all possible entries that are
100
+ queried for, false to raise an exception whenever one of the
101
+ entries looked for cannot be shown for whichever reason.
102
+ """
103
+
104
+ return self._get(category='studies', resource='acl', query_id=studies, **options)
105
+
106
+ def info(self, studies, **options):
107
+ """
108
+ Fetch study information.
109
+ PATH: /{apiVersion}/studies/{studies}/info
110
+
111
+ :param str studies: Comma separated list of Studies
112
+ [[organization@]project:]study where study and project can be
113
+ either the ID or UUID up to a maximum of 100. (REQUIRED)
114
+ :param str include: Fields included in the response, whole JSON path
115
+ must be provided.
116
+ :param str exclude: Fields excluded in the response, whole JSON path
117
+ must be provided.
118
+ """
119
+
120
+ return self._get(category='studies', resource='info', query_id=studies, **options)
121
+
122
+ def search_audit(self, study, **options):
123
+ """
124
+ Search audit collection.
125
+ PATH: /{apiVersion}/studies/{study}/audit/search
126
+
127
+ :param str study: Study ID. (REQUIRED)
128
+ :param str include: Fields included in the response, whole JSON path
129
+ must be provided.
130
+ :param str exclude: Fields excluded in the response, whole JSON path
131
+ must be provided.
132
+ :param int limit: Number of results to be returned.
133
+ :param int skip: Number of results to skip.
134
+ :param bool count: Get the total number of results matching the query.
135
+ Deactivated by default.
136
+ :param str operation_id: Audit operation UUID.
137
+ :param str user_id: User ID.
138
+ :param str action: Action performed by the user.
139
+ :param str resource: Resource involved. Allowed values: ['AUDIT NOTE
140
+ ORGANIZATION USER PROJECT STUDY FILE SAMPLE JOB INDIVIDUAL COHORT
141
+ DISEASE_PANEL FAMILY CLINICAL_ANALYSIS INTERPRETATION VARIANT
142
+ ALIGNMENT CLINICAL EXPRESSION RGA FUNCTIONAL WORKFLOW RESOURCE']
143
+ :param str resource_id: Resource ID.
144
+ :param str resource_uuid: resource UUID.
145
+ :param str status: Filter by status. Allowed values: ['SUCCESS ERROR']
146
+ :param str date: Date. Format: yyyyMMddHHmmss. Examples: >2018,
147
+ 2017-2018, <201805.
148
+ """
149
+
150
+ return self._get(category='studies', resource='search', query_id=study, subcategory='audit', **options)
151
+
152
+ def groups(self, study, **options):
153
+ """
154
+ Return the groups present in the study. For owners and administrators
155
+ only.
156
+ PATH: /{apiVersion}/studies/{study}/groups
157
+
158
+ :param str study: Study [[organization@]project:]study where study and
159
+ project can be either the ID or UUID. (REQUIRED)
160
+ :param str id: Group id. If provided, it will only fetch information
161
+ for the provided group.
162
+ :param bool silent: Boolean to retrieve all possible entries that are
163
+ queried for, false to raise an exception whenever one of the
164
+ entries looked for cannot be shown for whichever reason.
165
+ """
166
+
167
+ return self._get(category='studies', resource='groups', query_id=study, **options)
168
+
169
+ def update_groups(self, study, data=None, **options):
170
+ """
171
+ Add or remove a group.
172
+ PATH: /{apiVersion}/studies/{study}/groups/update
173
+
174
+ :param dict data: JSON containing the parameters. (REQUIRED)
175
+ :param str study: Study [[organization@]project:]study where study and
176
+ project can be either the ID or UUID. (REQUIRED)
177
+ :param str action: Action to be performed: ADD or REMOVE a group.
178
+ Allowed values: ['ADD REMOVE']
179
+ """
180
+
181
+ return self._post(category='studies', resource='update', query_id=study, subcategory='groups', data=data, **options)
182
+
183
+ def update_groups_users(self, study, group, data=None, **options):
184
+ """
185
+ Add, set or remove users from an existing group.
186
+ PATH: /{apiVersion}/studies/{study}/groups/{group}/users/update
187
+
188
+ :param dict data: JSON containing the parameters. (REQUIRED)
189
+ :param str group: Group name. (REQUIRED)
190
+ :param str study: Study [[organization@]project:]study where study and
191
+ project can be either the ID or UUID. (REQUIRED)
192
+ :param str action: Action to be performed: ADD, SET or REMOVE users
193
+ to/from a group. Allowed values: ['ADD SET REMOVE']
194
+ """
195
+
196
+ return self._post(category='studies', resource='users/update', query_id=study, subcategory='groups', second_query_id=group, data=data, **options)
197
+
198
+ def create_notes(self, study, data=None, **options):
199
+ """
200
+ Create a new note.
201
+ PATH: /{apiVersion}/studies/{study}/notes/create
202
+
203
+ :param dict data: JSON containing the Note to be added. (REQUIRED)
204
+ :param str study: Study [[organization@]project:]study where study and
205
+ project can be either the ID or UUID. (REQUIRED)
206
+ :param str include: Fields included in the response, whole JSON path
207
+ must be provided.
208
+ :param str exclude: Fields excluded in the response, whole JSON path
209
+ must be provided.
210
+ :param bool include_result: Flag indicating to include the created or
211
+ updated document result in the response.
212
+ """
213
+
214
+ return self._post(category='studies', resource='create', query_id=study, subcategory='notes', data=data, **options)
215
+
216
+ def search_notes(self, study, **options):
217
+ """
218
+ Search for notes of scope STUDY.
219
+ PATH: /{apiVersion}/studies/{study}/notes/search
220
+
221
+ :param str study: Study [[organization@]project:]study where study and
222
+ project can be either the ID or UUID. (REQUIRED)
223
+ :param str include: Fields included in the response, whole JSON path
224
+ must be provided.
225
+ :param str exclude: Fields excluded in the response, whole JSON path
226
+ must be provided.
227
+ :param str creation_date: Creation date. Format: yyyyMMddHHmmss.
228
+ Examples: >2018, 2017-2018, <201805.
229
+ :param str modification_date: Modification date. Format:
230
+ yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805.
231
+ :param str id: Note unique identifier.
232
+ :param str type: Note type.
233
+ :param str uuid: Unique 32-character identifier assigned automatically
234
+ by OpenCGA.
235
+ :param str user_id: User that wrote that Note.
236
+ :param str tags: Note tags.
237
+ :param str visibility: Visibility of the Note.
238
+ :param str version: Autoincremental version assigned to the registered
239
+ entry. By default, updates does not create new versions. To enable
240
+ versioning, users must set the `incVersion` flag from the /update
241
+ web service when updating the document.
242
+ """
243
+
244
+ return self._get(category='studies', resource='search', query_id=study, subcategory='notes', **options)
245
+
246
+ def delete_notes(self, study, id, **options):
247
+ """
248
+ Delete note.
249
+ PATH: /{apiVersion}/studies/{study}/notes/{id}/delete
250
+
251
+ :param str id: Note unique identifier. (REQUIRED)
252
+ :param str study: Study [[organization@]project:]study where study and
253
+ project can be either the ID or UUID. (REQUIRED)
254
+ :param bool include_result: Flag indicating to include the created or
255
+ updated document result in the response.
256
+ """
257
+
258
+ return self._delete(category='studies', resource='delete', query_id=study, subcategory='notes', second_query_id=id, **options)
259
+
260
+ def update_notes(self, study, id, data=None, **options):
261
+ """
262
+ Update a note.
263
+ PATH: /{apiVersion}/studies/{study}/notes/{id}/update
264
+
265
+ :param dict data: JSON containing the Note fields to be updated.
266
+ (REQUIRED)
267
+ :param str id: Note unique identifier. (REQUIRED)
268
+ :param str study: Study [[organization@]project:]study where study and
269
+ project can be either the ID or UUID. (REQUIRED)
270
+ :param str include: Fields included in the response, whole JSON path
271
+ must be provided.
272
+ :param str exclude: Fields excluded in the response, whole JSON path
273
+ must be provided.
274
+ :param str tags_action: Action to be performed if the array of tags is
275
+ being updated. Allowed values: ['ADD SET REMOVE']
276
+ :param bool include_result: Flag indicating to include the created or
277
+ updated document result in the response.
278
+ """
279
+
280
+ return self._post(category='studies', resource='update', query_id=study, subcategory='notes', second_query_id=id, data=data, **options)
281
+
282
+ def permission_rules(self, study, entity, **options):
283
+ """
284
+ Fetch permission rules.
285
+ PATH: /{apiVersion}/studies/{study}/permissionRules
286
+
287
+ :param str entity: Entity where the permission rules should be applied
288
+ to. Allowed values: ['SAMPLES FILES COHORTS INDIVIDUALS FAMILIES
289
+ JOBS CLINICAL_ANALYSES DISEASE_PANELS'] (REQUIRED)
290
+ :param str study: Study [[organization@]project:]study where study and
291
+ project can be either the ID or UUID. (REQUIRED)
292
+ """
293
+
294
+ options['entity'] = entity
295
+ return self._get(category='studies', resource='permissionRules', query_id=study, **options)
296
+
297
+ def update_permission_rules(self, study, entity, data=None, **options):
298
+ """
299
+ Add or remove a permission rule.
300
+ PATH: /{apiVersion}/studies/{study}/permissionRules/update
301
+
302
+ :param dict data: JSON containing the permission rule to be created or
303
+ removed. (REQUIRED)
304
+ :param str entity: Entity where the permission rules should be applied
305
+ to. Allowed values: ['SAMPLES FILES COHORTS INDIVIDUALS FAMILIES
306
+ JOBS CLINICAL_ANALYSES DISEASE_PANELS'] (REQUIRED)
307
+ :param str study: Study [[organization@]project:]study where study and
308
+ project can be either the ID or UUID. (REQUIRED)
309
+ :param str action: Action to be performed: ADD to add a new permission
310
+ rule; REMOVE to remove all permissions assigned by an existing
311
+ permission rule (even if it overlaps any manual permission); REVERT
312
+ to remove all permissions assigned by an existing permission rule
313
+ (keep manual overlaps); NONE to remove an existing permission rule
314
+ without removing any permissions that could have been assigned
315
+ already by the permission rule. Allowed values: ['ADD REMOVE REVERT
316
+ NONE']
317
+ """
318
+
319
+ options['entity'] = entity
320
+ return self._post(category='studies', resource='update', query_id=study, subcategory='permissionRules', data=data, **options)
321
+
322
+ def run_templates(self, study, data=None, **options):
323
+ """
324
+ Execute template.
325
+ PATH: /{apiVersion}/studies/{study}/templates/run
326
+
327
+ :param dict data: Template loader parameters. (REQUIRED)
328
+ :param str study: Study [[organization@]project:]study where study and
329
+ project can be either the ID or UUID. (REQUIRED)
330
+ :param str job_id: Job ID. It must be a unique string within the
331
+ study. An ID will be autogenerated automatically if not provided.
332
+ :param str job_depends_on: Comma separated list of existing job IDs
333
+ the job will depend on.
334
+ :param str job_description: Job description.
335
+ :param str job_tags: Job tags.
336
+ :param str job_scheduled_start_time: Time when the job is scheduled to
337
+ start.
338
+ :param str job_priority: Priority of the job.
339
+ :param bool job_dry_run: Flag indicating that the job will be executed
340
+ in dry-run mode. In this mode, OpenCGA will validate that all
341
+ parameters and prerequisites are correctly set for successful
342
+ execution, but the job will not actually run.
343
+ """
344
+
345
+ return self._post(category='studies', resource='run', query_id=study, subcategory='templates', data=data, **options)
346
+
347
+ def upload_templates(self, study, **options):
348
+ """
349
+ Resource to upload a zipped template.
350
+ PATH: /{apiVersion}/studies/{study}/templates/upload
351
+
352
+ :param str study: Study [[organization@]project:]study where study and
353
+ project can be either the ID or UUID. (REQUIRED)
354
+ :param inputstream file: File to upload.
355
+ """
356
+
357
+ return self._post(category='studies', resource='upload', query_id=study, subcategory='templates', **options)
358
+
359
+ def delete_templates(self, study, template_id, **options):
360
+ """
361
+ Delete template.
362
+ PATH: /{apiVersion}/studies/{study}/templates/{templateId}/delete
363
+
364
+ :param str template_id: Template id. (REQUIRED)
365
+ :param str study: Study [[organization@]project:]study where study and
366
+ project can be either the ID or UUID. (REQUIRED)
367
+ """
368
+
369
+ return self._delete(category='studies', resource='delete', query_id=study, subcategory='templates', second_query_id=template_id, **options)
370
+
371
+ def update(self, study, data=None, **options):
372
+ """
373
+ Update some study attributes.
374
+ PATH: /{apiVersion}/studies/{study}/update
375
+
376
+ :param dict data: JSON containing the params to be updated. (REQUIRED)
377
+ :param str study: Study [[organization@]project:]study where study and
378
+ project can be either the ID or UUID. (REQUIRED)
379
+ :param str include: Fields included in the response, whole JSON path
380
+ must be provided.
381
+ :param str exclude: Fields excluded in the response, whole JSON path
382
+ must be provided.
383
+ :param bool include_result: Flag indicating to include the created or
384
+ updated document result in the response.
385
+ """
386
+
387
+ return self._post(category='studies', resource='update', query_id=study, data=data, **options)
388
+
389
+ def variable_sets(self, study, **options):
390
+ """
391
+ Fetch variableSets from a study.
392
+ PATH: /{apiVersion}/studies/{study}/variableSets
393
+
394
+ :param str study: Study [[organization@]project:]study where study and
395
+ project can be either the ID or UUID. (REQUIRED)
396
+ :param str id: Id of the variableSet to be retrieved. If no id is
397
+ passed, it will show all the variableSets of the study.
398
+ """
399
+
400
+ return self._get(category='studies', resource='variableSets', query_id=study, **options)
401
+
402
+ def update_variable_sets(self, study, data=None, **options):
403
+ """
404
+ Add or remove a variableSet.
405
+ PATH: /{apiVersion}/studies/{study}/variableSets/update
406
+
407
+ :param dict data: JSON containing the VariableSet to be created or
408
+ removed. (REQUIRED)
409
+ :param str study: Study [[organization@]project:]study where study and
410
+ project can be either the ID or UUID. (REQUIRED)
411
+ :param str action: Action to be performed: ADD, REMOVE or FORCE_REMOVE
412
+ a variableSet. Allowed values: ['ADD REMOVE FORCE_REMOVE']
413
+ """
414
+
415
+ return self._post(category='studies', resource='update', query_id=study, subcategory='variableSets', data=data, **options)
416
+
417
+ def update_variable_sets_variables(self, study, variable_set, data=None, **options):
418
+ """
419
+ Add or remove variables to a VariableSet.
420
+ PATH: /{apiVersion}/studies/{study}/variableSets/{variableSet}/variables/update
421
+
422
+ :param dict data: JSON containing the variable to be added or removed.
423
+ For removing, only the variable id will be needed. (REQUIRED)
424
+ :param str variable_set: VariableSet id of the VariableSet to be
425
+ updated. (REQUIRED)
426
+ :param str study: Study [[organization@]project:]study where study and
427
+ project can be either the ID or UUID. (REQUIRED)
428
+ :param str action: Action to be performed: ADD or REMOVE a variable.
429
+ Allowed values: ['ADD REMOVE']
430
+ """
431
+
432
+ return self._post(category='studies', resource='variables/update', query_id=study, subcategory='variableSets', second_query_id=variable_set, data=data, **options)
433
+
@@ -0,0 +1,192 @@
1
+ """
2
+ WARNING: AUTOGENERATED CODE
3
+
4
+ This code was generated by a tool.
5
+
6
+ Manual changes to this file may cause unexpected behavior in your application.
7
+ Manual changes to this file will be overwritten if the code is regenerated.
8
+ """
9
+
10
+ from pyopencga.rest_clients._parent_rest_clients import _ParentRestClient
11
+
12
+
13
+ class User(_ParentRestClient):
14
+ """
15
+ This class contains methods for the 'Users' webservices
16
+ PATH: /{apiVersion}/users
17
+ """
18
+
19
+ def __init__(self, configuration, token=None, login_handler=None, *args, **kwargs):
20
+ super(User, self).__init__(configuration, token, login_handler, *args, **kwargs)
21
+
22
+ def anonymous(self, organization, **options):
23
+ """
24
+ Get an anonymous token to gain access to the system.
25
+ PATH: /{apiVersion}/users/anonymous
26
+
27
+ :param str organization: Organization id. (REQUIRED)
28
+ """
29
+
30
+ options['organization'] = organization
31
+ return self._post(category='users', resource='anonymous', **options)
32
+
33
+ def create(self, data=None, **options):
34
+ """
35
+ Create a new user.
36
+ PATH: /{apiVersion}/users/create
37
+
38
+ :param dict data: JSON containing the parameters. (REQUIRED)
39
+ """
40
+
41
+ return self._post(category='users', resource='create', data=data, **options)
42
+
43
+ def login(self, data=None, **options):
44
+ """
45
+ Get identified and gain access to the system.
46
+ PATH: /{apiVersion}/users/login
47
+
48
+ :param dict data: JSON containing the authentication parameters.
49
+ """
50
+
51
+ return self._post(category='users', resource='login', data=data, **options)
52
+
53
+ def password(self, data=None, **options):
54
+ """
55
+ Change the password of a user.
56
+ PATH: /{apiVersion}/users/password
57
+
58
+ :param dict data: JSON containing the change of password parameters.
59
+ (REQUIRED)
60
+ """
61
+
62
+ return self._post(category='users', resource='password', data=data, **options)
63
+
64
+ def search(self, **options):
65
+ """
66
+ User search method.
67
+ PATH: /{apiVersion}/users/search
68
+
69
+ :param str include: Fields included in the response, whole JSON path
70
+ must be provided.
71
+ :param str exclude: Fields excluded in the response, whole JSON path
72
+ must be provided.
73
+ :param int limit: Number of results to be returned.
74
+ :param int skip: Number of results to skip.
75
+ :param bool count: Get the total number of results matching the query.
76
+ Deactivated by default.
77
+ :param str organization: Organization id.
78
+ :param str id: Comma separated list user IDs up to a maximum of 100.
79
+ Also admits basic regular expressions using the operator '~', i.e.
80
+ '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for
81
+ case insensitive search.
82
+ :param str authentication_id: Authentication origin ID.
83
+ """
84
+
85
+ return self._get(category='users', resource='search', **options)
86
+
87
+ def info(self, users, **options):
88
+ """
89
+ Return the user information including its projects and studies.
90
+ PATH: /{apiVersion}/users/{users}/info
91
+
92
+ :param str users: Comma separated list of user IDs. (REQUIRED)
93
+ :param str include: Fields included in the response, whole JSON path
94
+ must be provided.
95
+ :param str exclude: Fields excluded in the response, whole JSON path
96
+ must be provided.
97
+ :param str organization: Organization id.
98
+ """
99
+
100
+ return self._get(category='users', resource='info', query_id=users, **options)
101
+
102
+ def configs(self, user, **options):
103
+ """
104
+ Fetch a user configuration.
105
+ PATH: /{apiVersion}/users/{user}/configs
106
+
107
+ :param str user: User ID. (REQUIRED)
108
+ :param str name: Unique name (typically the name of the application).
109
+ """
110
+
111
+ return self._get(category='users', resource='configs', query_id=user, **options)
112
+
113
+ def update_configs(self, user, data=None, **options):
114
+ """
115
+ Add or remove a custom user configuration.
116
+ PATH: /{apiVersion}/users/{user}/configs/update
117
+
118
+ :param dict data: JSON containing anything useful for the application
119
+ such as user or default preferences. When removing, only the id
120
+ will be necessary. (REQUIRED)
121
+ :param str user: User ID. (REQUIRED)
122
+ :param str action: Action to be performed: ADD or REMOVE a group.
123
+ Allowed values: ['ADD REMOVE']
124
+ """
125
+
126
+ return self._post(category='users', resource='update', query_id=user, subcategory='configs', data=data, **options)
127
+
128
+ def filters(self, user, **options):
129
+ """
130
+ Fetch user filters.
131
+ PATH: /{apiVersion}/users/{user}/filters
132
+
133
+ :param str user: User ID. (REQUIRED)
134
+ :param str id: Filter id. If provided, it will only fetch the
135
+ specified filter.
136
+ """
137
+
138
+ return self._get(category='users', resource='filters', query_id=user, **options)
139
+
140
+ def update_filters(self, user, data=None, **options):
141
+ """
142
+ Add or remove a custom user filter.
143
+ PATH: /{apiVersion}/users/{user}/filters/update
144
+
145
+ :param dict data: Filter parameters. When removing, only the 'name' of
146
+ the filter will be necessary. (REQUIRED)
147
+ :param str user: User ID. (REQUIRED)
148
+ :param str action: Action to be performed: ADD or REMOVE a group.
149
+ Allowed values: ['ADD REMOVE']
150
+ """
151
+
152
+ return self._post(category='users', resource='update', query_id=user, subcategory='filters', data=data, **options)
153
+
154
+ def update_filter(self, user, filter_id, data=None, **options):
155
+ """
156
+ Update a custom filter.
157
+ PATH: /{apiVersion}/users/{user}/filters/{filterId}/update
158
+
159
+ :param dict data: Filter parameters. (REQUIRED)
160
+ :param str filter_id: Filter id. (REQUIRED)
161
+ :param str user: User ID. (REQUIRED)
162
+ """
163
+
164
+ return self._post(category='users', resource='update', query_id=user, subcategory='filters', second_query_id=filter_id, data=data, **options)
165
+
166
+ def reset_password(self, user, **options):
167
+ """
168
+ Reset password.
169
+ PATH: /{apiVersion}/users/{user}/password/reset
170
+
171
+ :param str user: User ID. (REQUIRED)
172
+ """
173
+
174
+ return self._get(category='users', resource='reset', query_id=user, subcategory='password', **options)
175
+
176
+ def update(self, user, data=None, **options):
177
+ """
178
+ Update some user attributes.
179
+ PATH: /{apiVersion}/users/{user}/update
180
+
181
+ :param dict data: JSON containing the params to be updated. (REQUIRED)
182
+ :param str user: User ID. (REQUIRED)
183
+ :param str include: Fields included in the response, whole JSON path
184
+ must be provided.
185
+ :param str exclude: Fields excluded in the response, whole JSON path
186
+ must be provided.
187
+ :param bool include_result: Flag indicating to include the created or
188
+ updated document result in the response.
189
+ """
190
+
191
+ return self._post(category='users', resource='update', query_id=user, data=data, **options)
192
+