files-com 1.6.208__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 files-com might be problematic. Click here for more details.

Files changed (126) hide show
  1. README.md +758 -0
  2. _VERSION +1 -0
  3. files_com-1.6.208.dist-info/METADATA +770 -0
  4. files_com-1.6.208.dist-info/RECORD +126 -0
  5. files_com-1.6.208.dist-info/WHEEL +5 -0
  6. files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.6.208.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +309 -0
  9. files_sdk/api.py +63 -0
  10. files_sdk/api_client.py +336 -0
  11. files_sdk/error.py +2981 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +119 -0
  14. files_sdk/models/account_line_item.py +51 -0
  15. files_sdk/models/action.py +49 -0
  16. files_sdk/models/action_notification_export.py +153 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/agent_push_update.py +44 -0
  19. files_sdk/models/api_key.py +318 -0
  20. files_sdk/models/api_request_log.py +105 -0
  21. files_sdk/models/app.py +89 -0
  22. files_sdk/models/as2_incoming_message.py +117 -0
  23. files_sdk/models/as2_outgoing_message.py +113 -0
  24. files_sdk/models/as2_partner.py +415 -0
  25. files_sdk/models/as2_station.py +282 -0
  26. files_sdk/models/auto.py +36 -0
  27. files_sdk/models/automation.py +823 -0
  28. files_sdk/models/automation_log.py +94 -0
  29. files_sdk/models/automation_run.py +112 -0
  30. files_sdk/models/bandwidth_snapshot.py +91 -0
  31. files_sdk/models/behavior.py +340 -0
  32. files_sdk/models/bundle.py +686 -0
  33. files_sdk/models/bundle_action.py +93 -0
  34. files_sdk/models/bundle_download.py +94 -0
  35. files_sdk/models/bundle_notification.py +252 -0
  36. files_sdk/models/bundle_path.py +37 -0
  37. files_sdk/models/bundle_recipient.py +133 -0
  38. files_sdk/models/bundle_registration.py +82 -0
  39. files_sdk/models/child_site_management_policy.py +278 -0
  40. files_sdk/models/clickwrap.py +268 -0
  41. files_sdk/models/dns_record.py +59 -0
  42. files_sdk/models/email_incoming_message.py +102 -0
  43. files_sdk/models/email_log.py +84 -0
  44. files_sdk/models/errors.py +37 -0
  45. files_sdk/models/exavault_api_request_log.py +102 -0
  46. files_sdk/models/external_event.py +148 -0
  47. files_sdk/models/file.py +851 -0
  48. files_sdk/models/file_action.py +39 -0
  49. files_sdk/models/file_comment.py +191 -0
  50. files_sdk/models/file_comment_reaction.py +125 -0
  51. files_sdk/models/file_migration.py +69 -0
  52. files_sdk/models/file_migration_log.py +88 -0
  53. files_sdk/models/file_upload_part.py +54 -0
  54. files_sdk/models/folder.py +186 -0
  55. files_sdk/models/form_field.py +43 -0
  56. files_sdk/models/form_field_set.py +265 -0
  57. files_sdk/models/ftp_action_log.py +104 -0
  58. files_sdk/models/gpg_key.py +333 -0
  59. files_sdk/models/group.py +338 -0
  60. files_sdk/models/group_user.py +235 -0
  61. files_sdk/models/history.py +236 -0
  62. files_sdk/models/history_export.py +238 -0
  63. files_sdk/models/history_export_result.py +98 -0
  64. files_sdk/models/holiday_region.py +58 -0
  65. files_sdk/models/image.py +37 -0
  66. files_sdk/models/inbound_s3_log.py +95 -0
  67. files_sdk/models/inbox_recipient.py +124 -0
  68. files_sdk/models/inbox_registration.py +79 -0
  69. files_sdk/models/inbox_upload.py +80 -0
  70. files_sdk/models/invoice.py +91 -0
  71. files_sdk/models/invoice_line_item.py +51 -0
  72. files_sdk/models/ip_address.py +119 -0
  73. files_sdk/models/key_lifecycle_rule.py +243 -0
  74. files_sdk/models/lock.py +174 -0
  75. files_sdk/models/message.py +244 -0
  76. files_sdk/models/message_comment.py +223 -0
  77. files_sdk/models/message_comment_reaction.py +181 -0
  78. files_sdk/models/message_reaction.py +170 -0
  79. files_sdk/models/notification.py +451 -0
  80. files_sdk/models/outbound_connection_log.py +105 -0
  81. files_sdk/models/partner.py +307 -0
  82. files_sdk/models/payment.py +91 -0
  83. files_sdk/models/payment_line_item.py +42 -0
  84. files_sdk/models/permission.py +190 -0
  85. files_sdk/models/preview.py +40 -0
  86. files_sdk/models/priority.py +63 -0
  87. files_sdk/models/project.py +205 -0
  88. files_sdk/models/public_hosting_request_log.py +101 -0
  89. files_sdk/models/public_ip_address.py +42 -0
  90. files_sdk/models/public_key.py +269 -0
  91. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  92. files_sdk/models/remote_mount_backend.py +438 -0
  93. files_sdk/models/remote_server.py +1854 -0
  94. files_sdk/models/remote_server_configuration_file.py +73 -0
  95. files_sdk/models/remote_server_credential.py +855 -0
  96. files_sdk/models/request.py +184 -0
  97. files_sdk/models/restore.py +142 -0
  98. files_sdk/models/scim_log.py +88 -0
  99. files_sdk/models/session.py +100 -0
  100. files_sdk/models/settings_change.py +71 -0
  101. files_sdk/models/sftp_action_log.py +108 -0
  102. files_sdk/models/sftp_host_key.py +215 -0
  103. files_sdk/models/share_group.py +228 -0
  104. files_sdk/models/share_group_member.py +41 -0
  105. files_sdk/models/siem_http_destination.py +1074 -0
  106. files_sdk/models/site.py +1289 -0
  107. files_sdk/models/snapshot.py +255 -0
  108. files_sdk/models/sso_strategy.py +168 -0
  109. files_sdk/models/status.py +42 -0
  110. files_sdk/models/style.py +152 -0
  111. files_sdk/models/sync.py +588 -0
  112. files_sdk/models/sync_log.py +86 -0
  113. files_sdk/models/sync_run.py +124 -0
  114. files_sdk/models/usage_by_top_level_dir.py +41 -0
  115. files_sdk/models/usage_daily_snapshot.py +93 -0
  116. files_sdk/models/usage_snapshot.py +73 -0
  117. files_sdk/models/user.py +1232 -0
  118. files_sdk/models/user_cipher_use.py +91 -0
  119. files_sdk/models/user_lifecycle_rule.py +355 -0
  120. files_sdk/models/user_request.py +166 -0
  121. files_sdk/models/user_sftp_client_use.py +68 -0
  122. files_sdk/models/web_dav_action_log.py +104 -0
  123. files_sdk/models/webhook_test.py +116 -0
  124. files_sdk/models/workspace.py +202 -0
  125. files_sdk/path_util.py +42 -0
  126. files_sdk/util.py +34 -0
@@ -0,0 +1,235 @@
1
+ import builtins # noqa: F401
2
+ from files_sdk.api import Api # noqa: F401
3
+ from files_sdk.list_obj import ListObj
4
+ from files_sdk.error import ( # noqa: F401
5
+ InvalidParameterError,
6
+ MissingParameterError,
7
+ NotImplementedError,
8
+ )
9
+
10
+
11
+ class GroupUser:
12
+ default_attributes = {
13
+ "group_name": None, # string - Group name
14
+ "group_id": None, # int64 - Group ID
15
+ "user_id": None, # int64 - User ID
16
+ "admin": None, # boolean - Is this user an administrator of this group?
17
+ "usernames": None, # string - Comma-delimited list of usernames who belong to this group (separated by commas).
18
+ "id": None, # int64 - Group User ID.
19
+ }
20
+
21
+ def __init__(self, attributes=None, options=None):
22
+ if not isinstance(attributes, dict):
23
+ attributes = {}
24
+ if not isinstance(options, dict):
25
+ options = {}
26
+ self.set_attributes(attributes)
27
+ self.options = options
28
+
29
+ def set_attributes(self, attributes):
30
+ for attribute, default_value in GroupUser.default_attributes.items():
31
+ setattr(self, attribute, attributes.get(attribute, default_value))
32
+
33
+ def get_attributes(self):
34
+ return {
35
+ k: getattr(self, k, None)
36
+ for k in GroupUser.default_attributes
37
+ if getattr(self, k, None) is not None
38
+ }
39
+
40
+ # Parameters:
41
+ # group_id (required) - int64 - Group ID to add user to.
42
+ # user_id (required) - int64 - User ID to add to group.
43
+ # admin - boolean - Is the user a group administrator?
44
+ def update(self, params=None):
45
+ if not isinstance(params, dict):
46
+ params = {}
47
+
48
+ if hasattr(self, "id") and self.id:
49
+ params["id"] = self.id
50
+ else:
51
+ raise MissingParameterError("Current object doesn't have a id")
52
+ if "id" not in params:
53
+ raise MissingParameterError("Parameter missing: id")
54
+ if "group_id" not in params:
55
+ raise MissingParameterError("Parameter missing: group_id")
56
+ if "user_id" not in params:
57
+ raise MissingParameterError("Parameter missing: user_id")
58
+ if "id" in params and not isinstance(params["id"], int):
59
+ raise InvalidParameterError("Bad parameter: id must be an int")
60
+ if "group_id" in params and not isinstance(params["group_id"], int):
61
+ raise InvalidParameterError(
62
+ "Bad parameter: group_id must be an int"
63
+ )
64
+ if "user_id" in params and not isinstance(params["user_id"], int):
65
+ raise InvalidParameterError(
66
+ "Bad parameter: user_id must be an int"
67
+ )
68
+ response, _options = Api.send_request(
69
+ "PATCH",
70
+ "/group_users/{id}".format(id=params["id"]),
71
+ params,
72
+ self.options,
73
+ )
74
+ return response.data
75
+
76
+ # Parameters:
77
+ # group_id (required) - int64 - Group ID from which to remove user.
78
+ # user_id (required) - int64 - User ID to remove from group.
79
+ def delete(self, params=None):
80
+ if not isinstance(params, dict):
81
+ params = {}
82
+
83
+ if hasattr(self, "id") and self.id:
84
+ params["id"] = self.id
85
+ else:
86
+ raise MissingParameterError("Current object doesn't have a id")
87
+ if "id" not in params:
88
+ raise MissingParameterError("Parameter missing: id")
89
+ if "group_id" not in params:
90
+ raise MissingParameterError("Parameter missing: group_id")
91
+ if "user_id" not in params:
92
+ raise MissingParameterError("Parameter missing: user_id")
93
+ if "id" in params and not isinstance(params["id"], int):
94
+ raise InvalidParameterError("Bad parameter: id must be an int")
95
+ if "group_id" in params and not isinstance(params["group_id"], int):
96
+ raise InvalidParameterError(
97
+ "Bad parameter: group_id must be an int"
98
+ )
99
+ if "user_id" in params and not isinstance(params["user_id"], int):
100
+ raise InvalidParameterError(
101
+ "Bad parameter: user_id must be an int"
102
+ )
103
+ Api.send_request(
104
+ "DELETE",
105
+ "/group_users/{id}".format(id=params["id"]),
106
+ params,
107
+ self.options,
108
+ )
109
+
110
+ def destroy(self, params=None):
111
+ self.delete(params)
112
+
113
+ def save(self):
114
+ if hasattr(self, "id") and self.id:
115
+ new_obj = self.update(self.get_attributes())
116
+ self.set_attributes(new_obj.get_attributes())
117
+ return True
118
+ else:
119
+ new_obj = create(self.get_attributes(), self.options)
120
+ self.set_attributes(new_obj.get_attributes())
121
+ return True
122
+
123
+
124
+ # Parameters:
125
+ # user_id - int64 - User ID. If provided, will return group_users of this user.
126
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
127
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
128
+ # group_id - int64 - Group ID. If provided, will return group_users of this group.
129
+ def list(params=None, options=None):
130
+ if not isinstance(params, dict):
131
+ params = {}
132
+ if not isinstance(options, dict):
133
+ options = {}
134
+ if "user_id" in params and not isinstance(params["user_id"], int):
135
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
136
+ if "cursor" in params and not isinstance(params["cursor"], str):
137
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
138
+ if "per_page" in params and not isinstance(params["per_page"], int):
139
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
140
+ if "group_id" in params and not isinstance(params["group_id"], int):
141
+ raise InvalidParameterError("Bad parameter: group_id must be an int")
142
+ return ListObj(GroupUser, "GET", "/group_users", params, options)
143
+
144
+
145
+ def all(params=None, options=None):
146
+ list(params, options)
147
+
148
+
149
+ # Parameters:
150
+ # group_id (required) - int64 - Group ID to add user to.
151
+ # user_id (required) - int64 - User ID to add to group.
152
+ # admin - boolean - Is the user a group administrator?
153
+ def create(params=None, options=None):
154
+ if not isinstance(params, dict):
155
+ params = {}
156
+ if not isinstance(options, dict):
157
+ options = {}
158
+ if "group_id" in params and not isinstance(params["group_id"], int):
159
+ raise InvalidParameterError("Bad parameter: group_id must be an int")
160
+ if "user_id" in params and not isinstance(params["user_id"], int):
161
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
162
+ if "admin" in params and not isinstance(params["admin"], bool):
163
+ raise InvalidParameterError("Bad parameter: admin must be an bool")
164
+ if "group_id" not in params:
165
+ raise MissingParameterError("Parameter missing: group_id")
166
+ if "user_id" not in params:
167
+ raise MissingParameterError("Parameter missing: user_id")
168
+ response, options = Api.send_request(
169
+ "POST", "/group_users", params, options
170
+ )
171
+ return GroupUser(response.data, options)
172
+
173
+
174
+ # Parameters:
175
+ # group_id (required) - int64 - Group ID to add user to.
176
+ # user_id (required) - int64 - User ID to add to group.
177
+ # admin - boolean - Is the user a group administrator?
178
+ def update(id, params=None, options=None):
179
+ if not isinstance(params, dict):
180
+ params = {}
181
+ if not isinstance(options, dict):
182
+ options = {}
183
+ params["id"] = id
184
+ if "id" in params and not isinstance(params["id"], int):
185
+ raise InvalidParameterError("Bad parameter: id must be an int")
186
+ if "group_id" in params and not isinstance(params["group_id"], int):
187
+ raise InvalidParameterError("Bad parameter: group_id must be an int")
188
+ if "user_id" in params and not isinstance(params["user_id"], int):
189
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
190
+ if "admin" in params and not isinstance(params["admin"], bool):
191
+ raise InvalidParameterError("Bad parameter: admin must be an bool")
192
+ if "id" not in params:
193
+ raise MissingParameterError("Parameter missing: id")
194
+ if "group_id" not in params:
195
+ raise MissingParameterError("Parameter missing: group_id")
196
+ if "user_id" not in params:
197
+ raise MissingParameterError("Parameter missing: user_id")
198
+ response, options = Api.send_request(
199
+ "PATCH", "/group_users/{id}".format(id=params["id"]), params, options
200
+ )
201
+ return GroupUser(response.data, options)
202
+
203
+
204
+ # Parameters:
205
+ # group_id (required) - int64 - Group ID from which to remove user.
206
+ # user_id (required) - int64 - User ID to remove from group.
207
+ def delete(id, params=None, options=None):
208
+ if not isinstance(params, dict):
209
+ params = {}
210
+ if not isinstance(options, dict):
211
+ options = {}
212
+ params["id"] = id
213
+ if "id" in params and not isinstance(params["id"], int):
214
+ raise InvalidParameterError("Bad parameter: id must be an int")
215
+ if "group_id" in params and not isinstance(params["group_id"], int):
216
+ raise InvalidParameterError("Bad parameter: group_id must be an int")
217
+ if "user_id" in params and not isinstance(params["user_id"], int):
218
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
219
+ if "id" not in params:
220
+ raise MissingParameterError("Parameter missing: id")
221
+ if "group_id" not in params:
222
+ raise MissingParameterError("Parameter missing: group_id")
223
+ if "user_id" not in params:
224
+ raise MissingParameterError("Parameter missing: user_id")
225
+ Api.send_request(
226
+ "DELETE", "/group_users/{id}".format(id=params["id"]), params, options
227
+ )
228
+
229
+
230
+ def destroy(id, params=None, options=None):
231
+ delete(id, params, options)
232
+
233
+
234
+ def new(*args, **kwargs):
235
+ return GroupUser(*args, **kwargs)
@@ -0,0 +1,236 @@
1
+ import builtins # noqa: F401
2
+ from files_sdk.models.action import Action
3
+ from files_sdk.api import Api # noqa: F401
4
+ from files_sdk.list_obj import ListObj
5
+ from files_sdk.error import ( # noqa: F401
6
+ InvalidParameterError,
7
+ MissingParameterError,
8
+ NotImplementedError,
9
+ )
10
+
11
+
12
+ class History:
13
+ default_attributes = {
14
+ "id": None, # int64 - Action ID
15
+ "path": None, # string - Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
16
+ "when": None, # date-time - Action occurrence date/time
17
+ "destination": None, # string - The destination path for this action, if applicable
18
+ "display": None, # string - Friendly displayed output
19
+ "ip": None, # string - IP Address that performed this action
20
+ "source": None, # string - The source path for this action, if applicable
21
+ "targets": None, # object - Targets
22
+ "user_id": None, # int64 - User ID
23
+ "username": None, # string - Username
24
+ "user_is_from_parent_site": None, # boolean - true if this change was performed by a user on a parent site.
25
+ "action": None, # string - Type of action
26
+ "failure_type": None, # string - Failure type. If action was a user login or session failure, why did it fail?
27
+ "interface": None, # string - Interface on which this action occurred.
28
+ }
29
+
30
+ def __init__(self, attributes=None, options=None):
31
+ if not isinstance(attributes, dict):
32
+ attributes = {}
33
+ if not isinstance(options, dict):
34
+ options = {}
35
+ self.set_attributes(attributes)
36
+ self.options = options
37
+
38
+ def set_attributes(self, attributes):
39
+ for attribute, default_value in History.default_attributes.items():
40
+ setattr(self, attribute, attributes.get(attribute, default_value))
41
+
42
+ def get_attributes(self):
43
+ return {
44
+ k: getattr(self, k, None)
45
+ for k in History.default_attributes
46
+ if getattr(self, k, None) is not None
47
+ }
48
+
49
+
50
+ # Parameters:
51
+ # start_at - string - Leave blank or set to a date/time to filter earlier entries.
52
+ # end_at - string - Leave blank or set to a date/time to filter later entries.
53
+ # display - string - Display format. Leave blank or set to `full` or `parent`.
54
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
55
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
56
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
57
+ # path (required) - string - Path to operate on.
58
+ def list_for_file(path, params=None, options=None):
59
+ if not isinstance(params, dict):
60
+ params = {}
61
+ if not isinstance(options, dict):
62
+ options = {}
63
+ params["path"] = path
64
+ if "start_at" in params and not isinstance(params["start_at"], str):
65
+ raise InvalidParameterError("Bad parameter: start_at must be an str")
66
+ if "end_at" in params and not isinstance(params["end_at"], str):
67
+ raise InvalidParameterError("Bad parameter: end_at must be an str")
68
+ if "display" in params and not isinstance(params["display"], str):
69
+ raise InvalidParameterError("Bad parameter: display must be an str")
70
+ if "cursor" in params and not isinstance(params["cursor"], str):
71
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
72
+ if "per_page" in params and not isinstance(params["per_page"], int):
73
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
74
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
75
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
76
+ if "path" in params and not isinstance(params["path"], str):
77
+ raise InvalidParameterError("Bad parameter: path must be an str")
78
+ if "path" not in params:
79
+ raise MissingParameterError("Parameter missing: path")
80
+ return ListObj(
81
+ Action,
82
+ "GET",
83
+ "/history/files/{path}".format(path=params["path"]),
84
+ params,
85
+ options,
86
+ )
87
+
88
+
89
+ # Parameters:
90
+ # start_at - string - Leave blank or set to a date/time to filter earlier entries.
91
+ # end_at - string - Leave blank or set to a date/time to filter later entries.
92
+ # display - string - Display format. Leave blank or set to `full` or `parent`.
93
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
94
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
95
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
96
+ # path (required) - string - Path to operate on.
97
+ def list_for_folder(path, params=None, options=None):
98
+ if not isinstance(params, dict):
99
+ params = {}
100
+ if not isinstance(options, dict):
101
+ options = {}
102
+ params["path"] = path
103
+ if "start_at" in params and not isinstance(params["start_at"], str):
104
+ raise InvalidParameterError("Bad parameter: start_at must be an str")
105
+ if "end_at" in params and not isinstance(params["end_at"], str):
106
+ raise InvalidParameterError("Bad parameter: end_at must be an str")
107
+ if "display" in params and not isinstance(params["display"], str):
108
+ raise InvalidParameterError("Bad parameter: display must be an str")
109
+ if "cursor" in params and not isinstance(params["cursor"], str):
110
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
111
+ if "per_page" in params and not isinstance(params["per_page"], int):
112
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
113
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
114
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
115
+ if "path" in params and not isinstance(params["path"], str):
116
+ raise InvalidParameterError("Bad parameter: path must be an str")
117
+ if "path" not in params:
118
+ raise MissingParameterError("Parameter missing: path")
119
+ return ListObj(
120
+ Action,
121
+ "GET",
122
+ "/history/folders/{path}".format(path=params["path"]),
123
+ params,
124
+ options,
125
+ )
126
+
127
+
128
+ # Parameters:
129
+ # start_at - string - Leave blank or set to a date/time to filter earlier entries.
130
+ # end_at - string - Leave blank or set to a date/time to filter later entries.
131
+ # display - string - Display format. Leave blank or set to `full` or `parent`.
132
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
133
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
134
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
135
+ # user_id (required) - int64 - User ID.
136
+ def list_for_user(user_id, params=None, options=None):
137
+ if not isinstance(params, dict):
138
+ params = {}
139
+ if not isinstance(options, dict):
140
+ options = {}
141
+ params["user_id"] = user_id
142
+ if "start_at" in params and not isinstance(params["start_at"], str):
143
+ raise InvalidParameterError("Bad parameter: start_at must be an str")
144
+ if "end_at" in params and not isinstance(params["end_at"], str):
145
+ raise InvalidParameterError("Bad parameter: end_at must be an str")
146
+ if "display" in params and not isinstance(params["display"], str):
147
+ raise InvalidParameterError("Bad parameter: display must be an str")
148
+ if "cursor" in params and not isinstance(params["cursor"], str):
149
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
150
+ if "per_page" in params and not isinstance(params["per_page"], int):
151
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
152
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
153
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
154
+ if "user_id" in params and not isinstance(params["user_id"], int):
155
+ raise InvalidParameterError("Bad parameter: user_id must be an int")
156
+ if "user_id" not in params:
157
+ raise MissingParameterError("Parameter missing: user_id")
158
+ return ListObj(
159
+ Action,
160
+ "GET",
161
+ "/history/users/{user_id}".format(user_id=params["user_id"]),
162
+ params,
163
+ options,
164
+ )
165
+
166
+
167
+ # Parameters:
168
+ # start_at - string - Leave blank or set to a date/time to filter earlier entries.
169
+ # end_at - string - Leave blank or set to a date/time to filter later entries.
170
+ # display - string - Display format. Leave blank or set to `full` or `parent`.
171
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
172
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
173
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
174
+ def list_logins(params=None, options=None):
175
+ if not isinstance(params, dict):
176
+ params = {}
177
+ if not isinstance(options, dict):
178
+ options = {}
179
+ if "start_at" in params and not isinstance(params["start_at"], str):
180
+ raise InvalidParameterError("Bad parameter: start_at must be an str")
181
+ if "end_at" in params and not isinstance(params["end_at"], str):
182
+ raise InvalidParameterError("Bad parameter: end_at must be an str")
183
+ if "display" in params and not isinstance(params["display"], str):
184
+ raise InvalidParameterError("Bad parameter: display must be an str")
185
+ if "cursor" in params and not isinstance(params["cursor"], str):
186
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
187
+ if "per_page" in params and not isinstance(params["per_page"], int):
188
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
189
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
190
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
191
+ return ListObj(Action, "GET", "/history/login", params, options)
192
+
193
+
194
+ # Parameters:
195
+ # start_at - string - Leave blank or set to a date/time to filter earlier entries.
196
+ # end_at - string - Leave blank or set to a date/time to filter later entries.
197
+ # display - string - Display format. Leave blank or set to `full` or `parent`.
198
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
199
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
200
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
201
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `user_id`, `folder` or `path`. Valid field combinations are `[ ]`, `[ path ]`, `[ path ]` or `[ path ]`.
202
+ # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
203
+ def list(params=None, options=None):
204
+ if not isinstance(params, dict):
205
+ params = {}
206
+ if not isinstance(options, dict):
207
+ options = {}
208
+ if "start_at" in params and not isinstance(params["start_at"], str):
209
+ raise InvalidParameterError("Bad parameter: start_at must be an str")
210
+ if "end_at" in params and not isinstance(params["end_at"], str):
211
+ raise InvalidParameterError("Bad parameter: end_at must be an str")
212
+ if "display" in params and not isinstance(params["display"], str):
213
+ raise InvalidParameterError("Bad parameter: display must be an str")
214
+ if "cursor" in params and not isinstance(params["cursor"], str):
215
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
216
+ if "per_page" in params and not isinstance(params["per_page"], int):
217
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
218
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
219
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
220
+ if "filter" in params and not isinstance(params["filter"], dict):
221
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
222
+ if "filter_prefix" in params and not isinstance(
223
+ params["filter_prefix"], dict
224
+ ):
225
+ raise InvalidParameterError(
226
+ "Bad parameter: filter_prefix must be an dict"
227
+ )
228
+ return ListObj(Action, "GET", "/history", params, options)
229
+
230
+
231
+ def all(params=None, options=None):
232
+ list(params, options)
233
+
234
+
235
+ def new(*args, **kwargs):
236
+ return History(*args, **kwargs)