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.
- README.md +758 -0
- _VERSION +1 -0
- files_com-1.6.208.dist-info/METADATA +770 -0
- files_com-1.6.208.dist-info/RECORD +126 -0
- files_com-1.6.208.dist-info/WHEEL +5 -0
- files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
- files_com-1.6.208.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +309 -0
- files_sdk/api.py +63 -0
- files_sdk/api_client.py +336 -0
- files_sdk/error.py +2981 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +119 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +153 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/agent_push_update.py +44 -0
- files_sdk/models/api_key.py +318 -0
- files_sdk/models/api_request_log.py +105 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +117 -0
- files_sdk/models/as2_outgoing_message.py +113 -0
- files_sdk/models/as2_partner.py +415 -0
- files_sdk/models/as2_station.py +282 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +823 -0
- files_sdk/models/automation_log.py +94 -0
- files_sdk/models/automation_run.py +112 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +340 -0
- files_sdk/models/bundle.py +686 -0
- files_sdk/models/bundle_action.py +93 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +252 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +133 -0
- files_sdk/models/bundle_registration.py +82 -0
- files_sdk/models/child_site_management_policy.py +278 -0
- files_sdk/models/clickwrap.py +268 -0
- files_sdk/models/dns_record.py +59 -0
- files_sdk/models/email_incoming_message.py +102 -0
- files_sdk/models/email_log.py +84 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +102 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +851 -0
- files_sdk/models/file_action.py +39 -0
- files_sdk/models/file_comment.py +191 -0
- files_sdk/models/file_comment_reaction.py +125 -0
- files_sdk/models/file_migration.py +69 -0
- files_sdk/models/file_migration_log.py +88 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +186 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +265 -0
- files_sdk/models/ftp_action_log.py +104 -0
- files_sdk/models/gpg_key.py +333 -0
- files_sdk/models/group.py +338 -0
- files_sdk/models/group_user.py +235 -0
- files_sdk/models/history.py +236 -0
- files_sdk/models/history_export.py +238 -0
- files_sdk/models/history_export_result.py +98 -0
- files_sdk/models/holiday_region.py +58 -0
- files_sdk/models/image.py +37 -0
- files_sdk/models/inbound_s3_log.py +95 -0
- files_sdk/models/inbox_recipient.py +124 -0
- files_sdk/models/inbox_registration.py +79 -0
- files_sdk/models/inbox_upload.py +80 -0
- files_sdk/models/invoice.py +91 -0
- files_sdk/models/invoice_line_item.py +51 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/key_lifecycle_rule.py +243 -0
- files_sdk/models/lock.py +174 -0
- files_sdk/models/message.py +244 -0
- files_sdk/models/message_comment.py +223 -0
- files_sdk/models/message_comment_reaction.py +181 -0
- files_sdk/models/message_reaction.py +170 -0
- files_sdk/models/notification.py +451 -0
- files_sdk/models/outbound_connection_log.py +105 -0
- files_sdk/models/partner.py +307 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +190 -0
- files_sdk/models/preview.py +40 -0
- files_sdk/models/priority.py +63 -0
- files_sdk/models/project.py +205 -0
- files_sdk/models/public_hosting_request_log.py +101 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +269 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_mount_backend.py +438 -0
- files_sdk/models/remote_server.py +1854 -0
- files_sdk/models/remote_server_configuration_file.py +73 -0
- files_sdk/models/remote_server_credential.py +855 -0
- files_sdk/models/request.py +184 -0
- files_sdk/models/restore.py +142 -0
- files_sdk/models/scim_log.py +88 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +108 -0
- files_sdk/models/sftp_host_key.py +215 -0
- files_sdk/models/share_group.py +228 -0
- files_sdk/models/share_group_member.py +41 -0
- files_sdk/models/siem_http_destination.py +1074 -0
- files_sdk/models/site.py +1289 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +168 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync.py +588 -0
- files_sdk/models/sync_log.py +86 -0
- files_sdk/models/sync_run.py +124 -0
- files_sdk/models/usage_by_top_level_dir.py +41 -0
- files_sdk/models/usage_daily_snapshot.py +93 -0
- files_sdk/models/usage_snapshot.py +73 -0
- files_sdk/models/user.py +1232 -0
- files_sdk/models/user_cipher_use.py +91 -0
- files_sdk/models/user_lifecycle_rule.py +355 -0
- files_sdk/models/user_request.py +166 -0
- files_sdk/models/user_sftp_client_use.py +68 -0
- files_sdk/models/web_dav_action_log.py +104 -0
- files_sdk/models/webhook_test.py +116 -0
- files_sdk/models/workspace.py +202 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FileAction:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"status": None, # string - Status of file operation.
|
|
13
|
+
"file_migration_id": None, # int64 - If status is pending, this is the id of the File Migration to check for status updates.
|
|
14
|
+
"path": None,
|
|
15
|
+
"destination": None,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def __init__(self, attributes=None, options=None):
|
|
19
|
+
if not isinstance(attributes, dict):
|
|
20
|
+
attributes = {}
|
|
21
|
+
if not isinstance(options, dict):
|
|
22
|
+
options = {}
|
|
23
|
+
self.set_attributes(attributes)
|
|
24
|
+
self.options = options
|
|
25
|
+
|
|
26
|
+
def set_attributes(self, attributes):
|
|
27
|
+
for attribute, default_value in FileAction.default_attributes.items():
|
|
28
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
29
|
+
|
|
30
|
+
def get_attributes(self):
|
|
31
|
+
return {
|
|
32
|
+
k: getattr(self, k, None)
|
|
33
|
+
for k in FileAction.default_attributes
|
|
34
|
+
if getattr(self, k, None) is not None
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def new(*args, **kwargs):
|
|
39
|
+
return FileAction(*args, **kwargs)
|
|
@@ -0,0 +1,191 @@
|
|
|
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 FileComment:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - File Comment ID
|
|
14
|
+
"body": None, # string - Comment body.
|
|
15
|
+
"reactions": None, # array(object) - Reactions to this comment.
|
|
16
|
+
"path": None, # string - File path.
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def __init__(self, attributes=None, options=None):
|
|
20
|
+
if not isinstance(attributes, dict):
|
|
21
|
+
attributes = {}
|
|
22
|
+
if not isinstance(options, dict):
|
|
23
|
+
options = {}
|
|
24
|
+
self.set_attributes(attributes)
|
|
25
|
+
self.options = options
|
|
26
|
+
|
|
27
|
+
def set_attributes(self, attributes):
|
|
28
|
+
for attribute, default_value in FileComment.default_attributes.items():
|
|
29
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
30
|
+
|
|
31
|
+
def get_attributes(self):
|
|
32
|
+
return {
|
|
33
|
+
k: getattr(self, k, None)
|
|
34
|
+
for k in FileComment.default_attributes
|
|
35
|
+
if getattr(self, k, None) is not None
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# Parameters:
|
|
39
|
+
# body (required) - string - Comment body.
|
|
40
|
+
def update(self, params=None):
|
|
41
|
+
if not isinstance(params, dict):
|
|
42
|
+
params = {}
|
|
43
|
+
|
|
44
|
+
if hasattr(self, "id") and self.id:
|
|
45
|
+
params["id"] = self.id
|
|
46
|
+
else:
|
|
47
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
48
|
+
if "id" not in params:
|
|
49
|
+
raise MissingParameterError("Parameter missing: id")
|
|
50
|
+
if "body" not in params:
|
|
51
|
+
raise MissingParameterError("Parameter missing: body")
|
|
52
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
53
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
54
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
55
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
56
|
+
response, _options = Api.send_request(
|
|
57
|
+
"PATCH",
|
|
58
|
+
"/file_comments/{id}".format(id=params["id"]),
|
|
59
|
+
params,
|
|
60
|
+
self.options,
|
|
61
|
+
)
|
|
62
|
+
return response.data
|
|
63
|
+
|
|
64
|
+
def delete(self, params=None):
|
|
65
|
+
if not isinstance(params, dict):
|
|
66
|
+
params = {}
|
|
67
|
+
|
|
68
|
+
if hasattr(self, "id") and self.id:
|
|
69
|
+
params["id"] = self.id
|
|
70
|
+
else:
|
|
71
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
72
|
+
if "id" not in params:
|
|
73
|
+
raise MissingParameterError("Parameter missing: id")
|
|
74
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
75
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
76
|
+
Api.send_request(
|
|
77
|
+
"DELETE",
|
|
78
|
+
"/file_comments/{id}".format(id=params["id"]),
|
|
79
|
+
params,
|
|
80
|
+
self.options,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
def destroy(self, params=None):
|
|
84
|
+
self.delete(params)
|
|
85
|
+
|
|
86
|
+
def save(self):
|
|
87
|
+
if hasattr(self, "id") and self.id:
|
|
88
|
+
new_obj = self.update(self.get_attributes())
|
|
89
|
+
self.set_attributes(new_obj.get_attributes())
|
|
90
|
+
return True
|
|
91
|
+
else:
|
|
92
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
93
|
+
self.set_attributes(new_obj.get_attributes())
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# Parameters:
|
|
98
|
+
# 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.
|
|
99
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
100
|
+
# path (required) - string - Path to operate on.
|
|
101
|
+
def list_for(path, params=None, options=None):
|
|
102
|
+
if not isinstance(params, dict):
|
|
103
|
+
params = {}
|
|
104
|
+
if not isinstance(options, dict):
|
|
105
|
+
options = {}
|
|
106
|
+
params["path"] = path
|
|
107
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
108
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
109
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
110
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
111
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
112
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
113
|
+
if "path" not in params:
|
|
114
|
+
raise MissingParameterError("Parameter missing: path")
|
|
115
|
+
return ListObj(
|
|
116
|
+
FileComment,
|
|
117
|
+
"GET",
|
|
118
|
+
"/file_comments/files/{path}".format(path=params["path"]),
|
|
119
|
+
params,
|
|
120
|
+
options,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# Parameters:
|
|
125
|
+
# body (required) - string - Comment body.
|
|
126
|
+
# path (required) - string - File path.
|
|
127
|
+
def create(params=None, options=None):
|
|
128
|
+
if not isinstance(params, dict):
|
|
129
|
+
params = {}
|
|
130
|
+
if not isinstance(options, dict):
|
|
131
|
+
options = {}
|
|
132
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
133
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
134
|
+
if "path" in params and not isinstance(params["path"], str):
|
|
135
|
+
raise InvalidParameterError("Bad parameter: path must be an str")
|
|
136
|
+
if "body" not in params:
|
|
137
|
+
raise MissingParameterError("Parameter missing: body")
|
|
138
|
+
if "path" not in params:
|
|
139
|
+
raise MissingParameterError("Parameter missing: path")
|
|
140
|
+
response, options = Api.send_request(
|
|
141
|
+
"POST", "/file_comments", params, options
|
|
142
|
+
)
|
|
143
|
+
return FileComment(response.data, options)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# Parameters:
|
|
147
|
+
# body (required) - string - Comment body.
|
|
148
|
+
def update(id, params=None, options=None):
|
|
149
|
+
if not isinstance(params, dict):
|
|
150
|
+
params = {}
|
|
151
|
+
if not isinstance(options, dict):
|
|
152
|
+
options = {}
|
|
153
|
+
params["id"] = id
|
|
154
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
155
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
156
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
157
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
158
|
+
if "id" not in params:
|
|
159
|
+
raise MissingParameterError("Parameter missing: id")
|
|
160
|
+
if "body" not in params:
|
|
161
|
+
raise MissingParameterError("Parameter missing: body")
|
|
162
|
+
response, options = Api.send_request(
|
|
163
|
+
"PATCH", "/file_comments/{id}".format(id=params["id"]), params, options
|
|
164
|
+
)
|
|
165
|
+
return FileComment(response.data, options)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def delete(id, params=None, options=None):
|
|
169
|
+
if not isinstance(params, dict):
|
|
170
|
+
params = {}
|
|
171
|
+
if not isinstance(options, dict):
|
|
172
|
+
options = {}
|
|
173
|
+
params["id"] = id
|
|
174
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
175
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
176
|
+
if "id" not in params:
|
|
177
|
+
raise MissingParameterError("Parameter missing: id")
|
|
178
|
+
Api.send_request(
|
|
179
|
+
"DELETE",
|
|
180
|
+
"/file_comments/{id}".format(id=params["id"]),
|
|
181
|
+
params,
|
|
182
|
+
options,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def destroy(id, params=None, options=None):
|
|
187
|
+
delete(id, params, options)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def new(*args, **kwargs):
|
|
191
|
+
return FileComment(*args, **kwargs)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FileCommentReaction:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - Reaction ID
|
|
13
|
+
"emoji": None, # string - Emoji used in the reaction.
|
|
14
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
15
|
+
"file_comment_id": None, # int64 - ID of file comment to attach reaction to.
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def __init__(self, attributes=None, options=None):
|
|
19
|
+
if not isinstance(attributes, dict):
|
|
20
|
+
attributes = {}
|
|
21
|
+
if not isinstance(options, dict):
|
|
22
|
+
options = {}
|
|
23
|
+
self.set_attributes(attributes)
|
|
24
|
+
self.options = options
|
|
25
|
+
|
|
26
|
+
def set_attributes(self, attributes):
|
|
27
|
+
for (
|
|
28
|
+
attribute,
|
|
29
|
+
default_value,
|
|
30
|
+
) in FileCommentReaction.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 FileCommentReaction.default_attributes
|
|
37
|
+
if getattr(self, k, None) is not None
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
def delete(self, params=None):
|
|
41
|
+
if not isinstance(params, dict):
|
|
42
|
+
params = {}
|
|
43
|
+
|
|
44
|
+
if hasattr(self, "id") and self.id:
|
|
45
|
+
params["id"] = self.id
|
|
46
|
+
else:
|
|
47
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
48
|
+
if "id" not in params:
|
|
49
|
+
raise MissingParameterError("Parameter missing: id")
|
|
50
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
51
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
52
|
+
Api.send_request(
|
|
53
|
+
"DELETE",
|
|
54
|
+
"/file_comment_reactions/{id}".format(id=params["id"]),
|
|
55
|
+
params,
|
|
56
|
+
self.options,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def destroy(self, params=None):
|
|
60
|
+
self.delete(params)
|
|
61
|
+
|
|
62
|
+
def save(self):
|
|
63
|
+
if hasattr(self, "id") and self.id:
|
|
64
|
+
raise NotImplementedError(
|
|
65
|
+
"The FileCommentReaction object doesn't support updates."
|
|
66
|
+
)
|
|
67
|
+
else:
|
|
68
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
69
|
+
self.set_attributes(new_obj.get_attributes())
|
|
70
|
+
return True
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# Parameters:
|
|
74
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
75
|
+
# file_comment_id (required) - int64 - ID of file comment to attach reaction to.
|
|
76
|
+
# emoji (required) - string - Emoji to react with.
|
|
77
|
+
def create(params=None, options=None):
|
|
78
|
+
if not isinstance(params, dict):
|
|
79
|
+
params = {}
|
|
80
|
+
if not isinstance(options, dict):
|
|
81
|
+
options = {}
|
|
82
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
83
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
84
|
+
if "file_comment_id" in params and not isinstance(
|
|
85
|
+
params["file_comment_id"], int
|
|
86
|
+
):
|
|
87
|
+
raise InvalidParameterError(
|
|
88
|
+
"Bad parameter: file_comment_id must be an int"
|
|
89
|
+
)
|
|
90
|
+
if "emoji" in params and not isinstance(params["emoji"], str):
|
|
91
|
+
raise InvalidParameterError("Bad parameter: emoji must be an str")
|
|
92
|
+
if "file_comment_id" not in params:
|
|
93
|
+
raise MissingParameterError("Parameter missing: file_comment_id")
|
|
94
|
+
if "emoji" not in params:
|
|
95
|
+
raise MissingParameterError("Parameter missing: emoji")
|
|
96
|
+
response, options = Api.send_request(
|
|
97
|
+
"POST", "/file_comment_reactions", params, options
|
|
98
|
+
)
|
|
99
|
+
return FileCommentReaction(response.data, options)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def delete(id, params=None, options=None):
|
|
103
|
+
if not isinstance(params, dict):
|
|
104
|
+
params = {}
|
|
105
|
+
if not isinstance(options, dict):
|
|
106
|
+
options = {}
|
|
107
|
+
params["id"] = id
|
|
108
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
109
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
110
|
+
if "id" not in params:
|
|
111
|
+
raise MissingParameterError("Parameter missing: id")
|
|
112
|
+
Api.send_request(
|
|
113
|
+
"DELETE",
|
|
114
|
+
"/file_comment_reactions/{id}".format(id=params["id"]),
|
|
115
|
+
params,
|
|
116
|
+
options,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def destroy(id, params=None, options=None):
|
|
121
|
+
delete(id, params, options)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def new(*args, **kwargs):
|
|
125
|
+
return FileCommentReaction(*args, **kwargs)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FileMigration:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"id": None, # int64 - File migration ID
|
|
13
|
+
"path": None, # string - Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
14
|
+
"dest_path": None, # string - Destination path
|
|
15
|
+
"files_moved": None, # int64 - Number of files processed
|
|
16
|
+
"files_total": None, # int64
|
|
17
|
+
"operation": None, # string - The type of operation
|
|
18
|
+
"region": None, # string - Region
|
|
19
|
+
"status": None, # string - Status
|
|
20
|
+
"log_url": None, # string - Link to download the log file for this migration.
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
def __init__(self, attributes=None, options=None):
|
|
24
|
+
if not isinstance(attributes, dict):
|
|
25
|
+
attributes = {}
|
|
26
|
+
if not isinstance(options, dict):
|
|
27
|
+
options = {}
|
|
28
|
+
self.set_attributes(attributes)
|
|
29
|
+
self.options = options
|
|
30
|
+
|
|
31
|
+
def set_attributes(self, attributes):
|
|
32
|
+
for (
|
|
33
|
+
attribute,
|
|
34
|
+
default_value,
|
|
35
|
+
) in FileMigration.default_attributes.items():
|
|
36
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
37
|
+
|
|
38
|
+
def get_attributes(self):
|
|
39
|
+
return {
|
|
40
|
+
k: getattr(self, k, None)
|
|
41
|
+
for k in FileMigration.default_attributes
|
|
42
|
+
if getattr(self, k, None) is not None
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Parameters:
|
|
47
|
+
# id (required) - int64 - File Migration ID.
|
|
48
|
+
def find(id, params=None, options=None):
|
|
49
|
+
if not isinstance(params, dict):
|
|
50
|
+
params = {}
|
|
51
|
+
if not isinstance(options, dict):
|
|
52
|
+
options = {}
|
|
53
|
+
params["id"] = id
|
|
54
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
55
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
56
|
+
if "id" not in params:
|
|
57
|
+
raise MissingParameterError("Parameter missing: id")
|
|
58
|
+
response, options = Api.send_request(
|
|
59
|
+
"GET", "/file_migrations/{id}".format(id=params["id"]), params, options
|
|
60
|
+
)
|
|
61
|
+
return FileMigration(response.data, options)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get(id, params=None, options=None):
|
|
65
|
+
find(id, params, options)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def new(*args, **kwargs):
|
|
69
|
+
return FileMigration(*args, **kwargs)
|
|
@@ -0,0 +1,88 @@
|
|
|
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 FileMigrationLog:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"timestamp": None, # date-time - Start Time of Action. Deprecrated: Use created_at.
|
|
14
|
+
"file_migration_id": None, # int64 - File Migration ID
|
|
15
|
+
"dest_path": None, # string - Destination path, for moves and copies
|
|
16
|
+
"error_type": None, # string - Error type, if applicable
|
|
17
|
+
"message": None, # string - Message
|
|
18
|
+
"operation": None, # string - Operation type
|
|
19
|
+
"path": None, # string - File path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
20
|
+
"status": None, # string - Status
|
|
21
|
+
"created_at": None, # date-time - Start Time of Action
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def __init__(self, attributes=None, options=None):
|
|
25
|
+
if not isinstance(attributes, dict):
|
|
26
|
+
attributes = {}
|
|
27
|
+
if not isinstance(options, dict):
|
|
28
|
+
options = {}
|
|
29
|
+
self.set_attributes(attributes)
|
|
30
|
+
self.options = options
|
|
31
|
+
|
|
32
|
+
def set_attributes(self, attributes):
|
|
33
|
+
for (
|
|
34
|
+
attribute,
|
|
35
|
+
default_value,
|
|
36
|
+
) in FileMigrationLog.default_attributes.items():
|
|
37
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
38
|
+
|
|
39
|
+
def get_attributes(self):
|
|
40
|
+
return {
|
|
41
|
+
k: getattr(self, k, None)
|
|
42
|
+
for k in FileMigrationLog.default_attributes
|
|
43
|
+
if getattr(self, k, None) is not None
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Parameters:
|
|
48
|
+
# 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.
|
|
49
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
50
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `file_migration_id`, `operation`, `status`, `type` or `created_at`. Valid field combinations are `[ file_migration_id ]`, `[ operation ]`, `[ status ]`, `[ type ]`, `[ created_at ]`, `[ file_migration_id, operation ]`, `[ file_migration_id, status ]`, `[ file_migration_id, type ]`, `[ file_migration_id, created_at ]`, `[ operation, status ]`, `[ operation, type ]`, `[ operation, created_at ]`, `[ status, type ]`, `[ status, created_at ]`, `[ type, created_at ]`, `[ file_migration_id, operation, status ]`, `[ file_migration_id, operation, type ]`, `[ file_migration_id, operation, created_at ]`, `[ file_migration_id, status, type ]`, `[ file_migration_id, status, created_at ]`, `[ file_migration_id, type, created_at ]`, `[ operation, status, type ]`, `[ operation, status, created_at ]`, `[ operation, type, created_at ]`, `[ status, type, created_at ]`, `[ file_migration_id, operation, status, type ]`, `[ file_migration_id, operation, status, created_at ]`, `[ file_migration_id, operation, type, created_at ]`, `[ file_migration_id, status, type, created_at ]`, `[ operation, status, type, created_at ]` or `[ file_migration_id, operation, status, type, created_at ]`.
|
|
51
|
+
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ file_migration_id ]`, `[ operation ]`, `[ status ]`, `[ type ]`, `[ created_at ]`, `[ file_migration_id, operation ]`, `[ file_migration_id, status ]`, `[ file_migration_id, type ]`, `[ file_migration_id, created_at ]`, `[ operation, status ]`, `[ operation, type ]`, `[ operation, created_at ]`, `[ status, type ]`, `[ status, created_at ]`, `[ type, created_at ]`, `[ file_migration_id, operation, status ]`, `[ file_migration_id, operation, type ]`, `[ file_migration_id, operation, created_at ]`, `[ file_migration_id, status, type ]`, `[ file_migration_id, status, created_at ]`, `[ file_migration_id, type, created_at ]`, `[ operation, status, type ]`, `[ operation, status, created_at ]`, `[ operation, type, created_at ]`, `[ status, type, created_at ]`, `[ file_migration_id, operation, status, type ]`, `[ file_migration_id, operation, status, created_at ]`, `[ file_migration_id, operation, type, created_at ]`, `[ file_migration_id, status, type, created_at ]`, `[ operation, status, type, created_at ]` or `[ file_migration_id, operation, status, type, created_at ]`.
|
|
52
|
+
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ file_migration_id ]`, `[ operation ]`, `[ status ]`, `[ type ]`, `[ created_at ]`, `[ file_migration_id, operation ]`, `[ file_migration_id, status ]`, `[ file_migration_id, type ]`, `[ file_migration_id, created_at ]`, `[ operation, status ]`, `[ operation, type ]`, `[ operation, created_at ]`, `[ status, type ]`, `[ status, created_at ]`, `[ type, created_at ]`, `[ file_migration_id, operation, status ]`, `[ file_migration_id, operation, type ]`, `[ file_migration_id, operation, created_at ]`, `[ file_migration_id, status, type ]`, `[ file_migration_id, status, created_at ]`, `[ file_migration_id, type, created_at ]`, `[ operation, status, type ]`, `[ operation, status, created_at ]`, `[ operation, type, created_at ]`, `[ status, type, created_at ]`, `[ file_migration_id, operation, status, type ]`, `[ file_migration_id, operation, status, created_at ]`, `[ file_migration_id, operation, type, created_at ]`, `[ file_migration_id, status, type, created_at ]`, `[ operation, status, type, created_at ]` or `[ file_migration_id, operation, status, type, created_at ]`.
|
|
53
|
+
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. Valid field combinations are `[ file_migration_id ]`, `[ operation ]`, `[ status ]`, `[ type ]`, `[ created_at ]`, `[ file_migration_id, operation ]`, `[ file_migration_id, status ]`, `[ file_migration_id, type ]`, `[ file_migration_id, created_at ]`, `[ operation, status ]`, `[ operation, type ]`, `[ operation, created_at ]`, `[ status, type ]`, `[ status, created_at ]`, `[ type, created_at ]`, `[ file_migration_id, operation, status ]`, `[ file_migration_id, operation, type ]`, `[ file_migration_id, operation, created_at ]`, `[ file_migration_id, status, type ]`, `[ file_migration_id, status, created_at ]`, `[ file_migration_id, type, created_at ]`, `[ operation, status, type ]`, `[ operation, status, created_at ]`, `[ operation, type, created_at ]`, `[ status, type, created_at ]`, `[ file_migration_id, operation, status, type ]`, `[ file_migration_id, operation, status, created_at ]`, `[ file_migration_id, operation, type, created_at ]`, `[ file_migration_id, status, type, created_at ]`, `[ operation, status, type, created_at ]` or `[ file_migration_id, operation, status, type, created_at ]`.
|
|
54
|
+
# filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. Valid field combinations are `[ file_migration_id ]`, `[ operation ]`, `[ status ]`, `[ type ]`, `[ created_at ]`, `[ file_migration_id, operation ]`, `[ file_migration_id, status ]`, `[ file_migration_id, type ]`, `[ file_migration_id, created_at ]`, `[ operation, status ]`, `[ operation, type ]`, `[ operation, created_at ]`, `[ status, type ]`, `[ status, created_at ]`, `[ type, created_at ]`, `[ file_migration_id, operation, status ]`, `[ file_migration_id, operation, type ]`, `[ file_migration_id, operation, created_at ]`, `[ file_migration_id, status, type ]`, `[ file_migration_id, status, created_at ]`, `[ file_migration_id, type, created_at ]`, `[ operation, status, type ]`, `[ operation, status, created_at ]`, `[ operation, type, created_at ]`, `[ status, type, created_at ]`, `[ file_migration_id, operation, status, type ]`, `[ file_migration_id, operation, status, created_at ]`, `[ file_migration_id, operation, type, created_at ]`, `[ file_migration_id, status, type, created_at ]`, `[ operation, status, type, created_at ]` or `[ file_migration_id, operation, status, type, created_at ]`.
|
|
55
|
+
def list(params=None, options=None):
|
|
56
|
+
if not isinstance(params, dict):
|
|
57
|
+
params = {}
|
|
58
|
+
if not isinstance(options, dict):
|
|
59
|
+
options = {}
|
|
60
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
61
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
62
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
63
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
64
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
65
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
66
|
+
if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
|
|
67
|
+
raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
|
|
68
|
+
if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
|
|
69
|
+
raise InvalidParameterError(
|
|
70
|
+
"Bad parameter: filter_gteq must be an dict"
|
|
71
|
+
)
|
|
72
|
+
if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
|
|
73
|
+
raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
|
|
74
|
+
if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
|
|
75
|
+
raise InvalidParameterError(
|
|
76
|
+
"Bad parameter: filter_lteq must be an dict"
|
|
77
|
+
)
|
|
78
|
+
return ListObj(
|
|
79
|
+
FileMigrationLog, "GET", "/file_migration_logs", params, options
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def all(params=None, options=None):
|
|
84
|
+
list(params, options)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def new(*args, **kwargs):
|
|
88
|
+
return FileMigrationLog(*args, **kwargs)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.api import Api # noqa: F401
|
|
3
|
+
from files_sdk.error import ( # noqa: F401
|
|
4
|
+
InvalidParameterError,
|
|
5
|
+
MissingParameterError,
|
|
6
|
+
NotImplementedError,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FileUploadPart:
|
|
11
|
+
default_attributes = {
|
|
12
|
+
"send": None, # object - Content-Type and File to send
|
|
13
|
+
"action": None, # string - Type of upload
|
|
14
|
+
"ask_about_overwrites": None, # boolean - If `true`, this file exists and you may wish to ask the user for overwrite confirmation
|
|
15
|
+
"available_parts": None, # int64 - Number of parts in the upload
|
|
16
|
+
"expires": None, # string - Date/time of when this Upload part expires and the URL cannot be used any more
|
|
17
|
+
"headers": None, # object - Additional upload headers to provide as part of the upload
|
|
18
|
+
"http_method": None, # string - HTTP Method to use for uploading the part, usually `PUT`
|
|
19
|
+
"next_partsize": None, # int64 - Size in bytes for this part
|
|
20
|
+
"parallel_parts": None, # boolean - If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order.
|
|
21
|
+
"retry_parts": None, # boolean - If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted.
|
|
22
|
+
"parameters": None, # object - Additional HTTP parameters to send with the upload
|
|
23
|
+
"part_number": None, # int64 - Number of this upload part
|
|
24
|
+
"partsize": None, # int64 - Size in bytes for the next upload part
|
|
25
|
+
"path": None, # string - New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
26
|
+
"ref": None, # string - Reference name for this upload part
|
|
27
|
+
"upload_uri": None, # string - URI to upload this part to
|
|
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 (
|
|
40
|
+
attribute,
|
|
41
|
+
default_value,
|
|
42
|
+
) in FileUploadPart.default_attributes.items():
|
|
43
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
44
|
+
|
|
45
|
+
def get_attributes(self):
|
|
46
|
+
return {
|
|
47
|
+
k: getattr(self, k, None)
|
|
48
|
+
for k in FileUploadPart.default_attributes
|
|
49
|
+
if getattr(self, k, None) is not None
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def new(*args, **kwargs):
|
|
54
|
+
return FileUploadPart(*args, **kwargs)
|