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,223 @@
|
|
|
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 MessageComment:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Message Comment ID
|
|
14
|
+
"body": None, # string - Comment body.
|
|
15
|
+
"reactions": None, # array(object) - Reactions to this comment.
|
|
16
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
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 (
|
|
29
|
+
attribute,
|
|
30
|
+
default_value,
|
|
31
|
+
) in MessageComment.default_attributes.items():
|
|
32
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
33
|
+
|
|
34
|
+
def get_attributes(self):
|
|
35
|
+
return {
|
|
36
|
+
k: getattr(self, k, None)
|
|
37
|
+
for k in MessageComment.default_attributes
|
|
38
|
+
if getattr(self, k, None) is not None
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Parameters:
|
|
42
|
+
# body (required) - string - Comment body.
|
|
43
|
+
def update(self, params=None):
|
|
44
|
+
if not isinstance(params, dict):
|
|
45
|
+
params = {}
|
|
46
|
+
|
|
47
|
+
if hasattr(self, "id") and self.id:
|
|
48
|
+
params["id"] = self.id
|
|
49
|
+
else:
|
|
50
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
51
|
+
if "id" not in params:
|
|
52
|
+
raise MissingParameterError("Parameter missing: id")
|
|
53
|
+
if "body" not in params:
|
|
54
|
+
raise MissingParameterError("Parameter missing: body")
|
|
55
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
56
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
57
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
58
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
59
|
+
response, _options = Api.send_request(
|
|
60
|
+
"PATCH",
|
|
61
|
+
"/message_comments/{id}".format(id=params["id"]),
|
|
62
|
+
params,
|
|
63
|
+
self.options,
|
|
64
|
+
)
|
|
65
|
+
return response.data
|
|
66
|
+
|
|
67
|
+
def delete(self, params=None):
|
|
68
|
+
if not isinstance(params, dict):
|
|
69
|
+
params = {}
|
|
70
|
+
|
|
71
|
+
if hasattr(self, "id") and self.id:
|
|
72
|
+
params["id"] = self.id
|
|
73
|
+
else:
|
|
74
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
75
|
+
if "id" not in params:
|
|
76
|
+
raise MissingParameterError("Parameter missing: id")
|
|
77
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
78
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
79
|
+
Api.send_request(
|
|
80
|
+
"DELETE",
|
|
81
|
+
"/message_comments/{id}".format(id=params["id"]),
|
|
82
|
+
params,
|
|
83
|
+
self.options,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def destroy(self, params=None):
|
|
87
|
+
self.delete(params)
|
|
88
|
+
|
|
89
|
+
def save(self):
|
|
90
|
+
if hasattr(self, "id") and self.id:
|
|
91
|
+
new_obj = self.update(self.get_attributes())
|
|
92
|
+
self.set_attributes(new_obj.get_attributes())
|
|
93
|
+
return True
|
|
94
|
+
else:
|
|
95
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
96
|
+
self.set_attributes(new_obj.get_attributes())
|
|
97
|
+
return True
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# Parameters:
|
|
101
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
102
|
+
# 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.
|
|
103
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
104
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
105
|
+
# message_id (required) - int64 - Message comment to return comments for.
|
|
106
|
+
def list(params=None, options=None):
|
|
107
|
+
if not isinstance(params, dict):
|
|
108
|
+
params = {}
|
|
109
|
+
if not isinstance(options, dict):
|
|
110
|
+
options = {}
|
|
111
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
112
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
113
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
114
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
115
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
116
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
117
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
118
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
119
|
+
if "message_id" in params and not isinstance(params["message_id"], int):
|
|
120
|
+
raise InvalidParameterError("Bad parameter: message_id must be an int")
|
|
121
|
+
if "message_id" not in params:
|
|
122
|
+
raise MissingParameterError("Parameter missing: message_id")
|
|
123
|
+
return ListObj(MessageComment, "GET", "/message_comments", params, options)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def all(params=None, options=None):
|
|
127
|
+
list(params, options)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# Parameters:
|
|
131
|
+
# id (required) - int64 - Message Comment ID.
|
|
132
|
+
def find(id, params=None, options=None):
|
|
133
|
+
if not isinstance(params, dict):
|
|
134
|
+
params = {}
|
|
135
|
+
if not isinstance(options, dict):
|
|
136
|
+
options = {}
|
|
137
|
+
params["id"] = id
|
|
138
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
139
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
140
|
+
if "id" not in params:
|
|
141
|
+
raise MissingParameterError("Parameter missing: id")
|
|
142
|
+
response, options = Api.send_request(
|
|
143
|
+
"GET",
|
|
144
|
+
"/message_comments/{id}".format(id=params["id"]),
|
|
145
|
+
params,
|
|
146
|
+
options,
|
|
147
|
+
)
|
|
148
|
+
return MessageComment(response.data, options)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def get(id, params=None, options=None):
|
|
152
|
+
find(id, params, options)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# Parameters:
|
|
156
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
157
|
+
# body (required) - string - Comment body.
|
|
158
|
+
def create(params=None, options=None):
|
|
159
|
+
if not isinstance(params, dict):
|
|
160
|
+
params = {}
|
|
161
|
+
if not isinstance(options, dict):
|
|
162
|
+
options = {}
|
|
163
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
164
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
165
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
166
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
167
|
+
if "body" not in params:
|
|
168
|
+
raise MissingParameterError("Parameter missing: body")
|
|
169
|
+
response, options = Api.send_request(
|
|
170
|
+
"POST", "/message_comments", params, options
|
|
171
|
+
)
|
|
172
|
+
return MessageComment(response.data, options)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
# Parameters:
|
|
176
|
+
# body (required) - string - Comment body.
|
|
177
|
+
def update(id, params=None, options=None):
|
|
178
|
+
if not isinstance(params, dict):
|
|
179
|
+
params = {}
|
|
180
|
+
if not isinstance(options, dict):
|
|
181
|
+
options = {}
|
|
182
|
+
params["id"] = id
|
|
183
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
184
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
185
|
+
if "body" in params and not isinstance(params["body"], str):
|
|
186
|
+
raise InvalidParameterError("Bad parameter: body must be an str")
|
|
187
|
+
if "id" not in params:
|
|
188
|
+
raise MissingParameterError("Parameter missing: id")
|
|
189
|
+
if "body" not in params:
|
|
190
|
+
raise MissingParameterError("Parameter missing: body")
|
|
191
|
+
response, options = Api.send_request(
|
|
192
|
+
"PATCH",
|
|
193
|
+
"/message_comments/{id}".format(id=params["id"]),
|
|
194
|
+
params,
|
|
195
|
+
options,
|
|
196
|
+
)
|
|
197
|
+
return MessageComment(response.data, options)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def delete(id, params=None, options=None):
|
|
201
|
+
if not isinstance(params, dict):
|
|
202
|
+
params = {}
|
|
203
|
+
if not isinstance(options, dict):
|
|
204
|
+
options = {}
|
|
205
|
+
params["id"] = id
|
|
206
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
207
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
208
|
+
if "id" not in params:
|
|
209
|
+
raise MissingParameterError("Parameter missing: id")
|
|
210
|
+
Api.send_request(
|
|
211
|
+
"DELETE",
|
|
212
|
+
"/message_comments/{id}".format(id=params["id"]),
|
|
213
|
+
params,
|
|
214
|
+
options,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def destroy(id, params=None, options=None):
|
|
219
|
+
delete(id, params, options)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def new(*args, **kwargs):
|
|
223
|
+
return MessageComment(*args, **kwargs)
|
|
@@ -0,0 +1,181 @@
|
|
|
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 MessageCommentReaction:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Reaction ID
|
|
14
|
+
"emoji": None, # string - Emoji used in the reaction.
|
|
15
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
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 MessageCommentReaction.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 MessageCommentReaction.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
|
+
"/message_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 MessageCommentReaction 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
|
+
# 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.
|
|
76
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
77
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
78
|
+
# message_comment_id (required) - int64 - Message comment to return reactions for.
|
|
79
|
+
def list(params=None, options=None):
|
|
80
|
+
if not isinstance(params, dict):
|
|
81
|
+
params = {}
|
|
82
|
+
if not isinstance(options, dict):
|
|
83
|
+
options = {}
|
|
84
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
85
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
86
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
87
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
88
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
89
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
90
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
91
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
92
|
+
if "message_comment_id" in params and not isinstance(
|
|
93
|
+
params["message_comment_id"], int
|
|
94
|
+
):
|
|
95
|
+
raise InvalidParameterError(
|
|
96
|
+
"Bad parameter: message_comment_id must be an int"
|
|
97
|
+
)
|
|
98
|
+
if "message_comment_id" not in params:
|
|
99
|
+
raise MissingParameterError("Parameter missing: message_comment_id")
|
|
100
|
+
return ListObj(
|
|
101
|
+
MessageCommentReaction,
|
|
102
|
+
"GET",
|
|
103
|
+
"/message_comment_reactions",
|
|
104
|
+
params,
|
|
105
|
+
options,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def all(params=None, options=None):
|
|
110
|
+
list(params, options)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# Parameters:
|
|
114
|
+
# id (required) - int64 - Message Comment Reaction ID.
|
|
115
|
+
def find(id, params=None, options=None):
|
|
116
|
+
if not isinstance(params, dict):
|
|
117
|
+
params = {}
|
|
118
|
+
if not isinstance(options, dict):
|
|
119
|
+
options = {}
|
|
120
|
+
params["id"] = id
|
|
121
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
122
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
123
|
+
if "id" not in params:
|
|
124
|
+
raise MissingParameterError("Parameter missing: id")
|
|
125
|
+
response, options = Api.send_request(
|
|
126
|
+
"GET",
|
|
127
|
+
"/message_comment_reactions/{id}".format(id=params["id"]),
|
|
128
|
+
params,
|
|
129
|
+
options,
|
|
130
|
+
)
|
|
131
|
+
return MessageCommentReaction(response.data, options)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def get(id, params=None, options=None):
|
|
135
|
+
find(id, params, options)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
# Parameters:
|
|
139
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
140
|
+
# emoji (required) - string - Emoji to react with.
|
|
141
|
+
def create(params=None, options=None):
|
|
142
|
+
if not isinstance(params, dict):
|
|
143
|
+
params = {}
|
|
144
|
+
if not isinstance(options, dict):
|
|
145
|
+
options = {}
|
|
146
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
147
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
148
|
+
if "emoji" in params and not isinstance(params["emoji"], str):
|
|
149
|
+
raise InvalidParameterError("Bad parameter: emoji must be an str")
|
|
150
|
+
if "emoji" not in params:
|
|
151
|
+
raise MissingParameterError("Parameter missing: emoji")
|
|
152
|
+
response, options = Api.send_request(
|
|
153
|
+
"POST", "/message_comment_reactions", params, options
|
|
154
|
+
)
|
|
155
|
+
return MessageCommentReaction(response.data, options)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def delete(id, params=None, options=None):
|
|
159
|
+
if not isinstance(params, dict):
|
|
160
|
+
params = {}
|
|
161
|
+
if not isinstance(options, dict):
|
|
162
|
+
options = {}
|
|
163
|
+
params["id"] = id
|
|
164
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
165
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
166
|
+
if "id" not in params:
|
|
167
|
+
raise MissingParameterError("Parameter missing: id")
|
|
168
|
+
Api.send_request(
|
|
169
|
+
"DELETE",
|
|
170
|
+
"/message_comment_reactions/{id}".format(id=params["id"]),
|
|
171
|
+
params,
|
|
172
|
+
options,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def destroy(id, params=None, options=None):
|
|
177
|
+
delete(id, params, options)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def new(*args, **kwargs):
|
|
181
|
+
return MessageCommentReaction(*args, **kwargs)
|
|
@@ -0,0 +1,170 @@
|
|
|
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 MessageReaction:
|
|
12
|
+
default_attributes = {
|
|
13
|
+
"id": None, # int64 - Reaction ID
|
|
14
|
+
"emoji": None, # string - Emoji used in the reaction.
|
|
15
|
+
"user_id": None, # int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
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 MessageReaction.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 MessageReaction.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
|
+
"/message_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 MessageReaction 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
|
+
# 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.
|
|
76
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
77
|
+
# message_id (required) - int64 - Message to return reactions for.
|
|
78
|
+
def list(params=None, options=None):
|
|
79
|
+
if not isinstance(params, dict):
|
|
80
|
+
params = {}
|
|
81
|
+
if not isinstance(options, dict):
|
|
82
|
+
options = {}
|
|
83
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
84
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
85
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
86
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
87
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
88
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
89
|
+
if "message_id" in params and not isinstance(params["message_id"], int):
|
|
90
|
+
raise InvalidParameterError("Bad parameter: message_id must be an int")
|
|
91
|
+
if "message_id" not in params:
|
|
92
|
+
raise MissingParameterError("Parameter missing: message_id")
|
|
93
|
+
return ListObj(
|
|
94
|
+
MessageReaction, "GET", "/message_reactions", params, options
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def all(params=None, options=None):
|
|
99
|
+
list(params, options)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# Parameters:
|
|
103
|
+
# id (required) - int64 - Message Reaction ID.
|
|
104
|
+
def find(id, params=None, options=None):
|
|
105
|
+
if not isinstance(params, dict):
|
|
106
|
+
params = {}
|
|
107
|
+
if not isinstance(options, dict):
|
|
108
|
+
options = {}
|
|
109
|
+
params["id"] = id
|
|
110
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
111
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
112
|
+
if "id" not in params:
|
|
113
|
+
raise MissingParameterError("Parameter missing: id")
|
|
114
|
+
response, options = Api.send_request(
|
|
115
|
+
"GET",
|
|
116
|
+
"/message_reactions/{id}".format(id=params["id"]),
|
|
117
|
+
params,
|
|
118
|
+
options,
|
|
119
|
+
)
|
|
120
|
+
return MessageReaction(response.data, options)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def get(id, params=None, options=None):
|
|
124
|
+
find(id, params, options)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# Parameters:
|
|
128
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
129
|
+
# emoji (required) - string - Emoji to react with.
|
|
130
|
+
def create(params=None, options=None):
|
|
131
|
+
if not isinstance(params, dict):
|
|
132
|
+
params = {}
|
|
133
|
+
if not isinstance(options, dict):
|
|
134
|
+
options = {}
|
|
135
|
+
if "user_id" in params and not isinstance(params["user_id"], int):
|
|
136
|
+
raise InvalidParameterError("Bad parameter: user_id must be an int")
|
|
137
|
+
if "emoji" in params and not isinstance(params["emoji"], str):
|
|
138
|
+
raise InvalidParameterError("Bad parameter: emoji must be an str")
|
|
139
|
+
if "emoji" not in params:
|
|
140
|
+
raise MissingParameterError("Parameter missing: emoji")
|
|
141
|
+
response, options = Api.send_request(
|
|
142
|
+
"POST", "/message_reactions", params, options
|
|
143
|
+
)
|
|
144
|
+
return MessageReaction(response.data, options)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def delete(id, params=None, options=None):
|
|
148
|
+
if not isinstance(params, dict):
|
|
149
|
+
params = {}
|
|
150
|
+
if not isinstance(options, dict):
|
|
151
|
+
options = {}
|
|
152
|
+
params["id"] = id
|
|
153
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
154
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
155
|
+
if "id" not in params:
|
|
156
|
+
raise MissingParameterError("Parameter missing: id")
|
|
157
|
+
Api.send_request(
|
|
158
|
+
"DELETE",
|
|
159
|
+
"/message_reactions/{id}".format(id=params["id"]),
|
|
160
|
+
params,
|
|
161
|
+
options,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def destroy(id, params=None, options=None):
|
|
166
|
+
delete(id, params, options)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def new(*args, **kwargs):
|
|
170
|
+
return MessageReaction(*args, **kwargs)
|