files-com 1.5.0__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 (113) hide show
  1. README.md +682 -0
  2. _VERSION +1 -0
  3. files_com-1.5.0.dist-info/METADATA +694 -0
  4. files_com-1.5.0.dist-info/RECORD +113 -0
  5. files_com-1.5.0.dist-info/WHEEL +5 -0
  6. files_com-1.5.0.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.5.0.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +270 -0
  9. files_sdk/api.py +57 -0
  10. files_sdk/api_client.py +327 -0
  11. files_sdk/error.py +2891 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +104 -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 +147 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/api_key.py +322 -0
  19. files_sdk/models/api_request_log.py +87 -0
  20. files_sdk/models/app.py +89 -0
  21. files_sdk/models/as2_incoming_message.py +123 -0
  22. files_sdk/models/as2_outgoing_message.py +119 -0
  23. files_sdk/models/as2_partner.py +374 -0
  24. files_sdk/models/as2_station.py +271 -0
  25. files_sdk/models/auto.py +36 -0
  26. files_sdk/models/automation.py +691 -0
  27. files_sdk/models/automation_log.py +77 -0
  28. files_sdk/models/automation_run.py +108 -0
  29. files_sdk/models/bandwidth_snapshot.py +91 -0
  30. files_sdk/models/behavior.py +334 -0
  31. files_sdk/models/bundle.py +550 -0
  32. files_sdk/models/bundle_action.py +86 -0
  33. files_sdk/models/bundle_download.py +94 -0
  34. files_sdk/models/bundle_notification.py +217 -0
  35. files_sdk/models/bundle_path.py +37 -0
  36. files_sdk/models/bundle_recipient.py +120 -0
  37. files_sdk/models/bundle_registration.py +79 -0
  38. files_sdk/models/clickwrap.py +268 -0
  39. files_sdk/models/dns_record.py +59 -0
  40. files_sdk/models/email_incoming_message.py +102 -0
  41. files_sdk/models/email_log.py +74 -0
  42. files_sdk/models/errors.py +37 -0
  43. files_sdk/models/exavault_api_request_log.py +85 -0
  44. files_sdk/models/external_event.py +148 -0
  45. files_sdk/models/file.py +791 -0
  46. files_sdk/models/file_action.py +39 -0
  47. files_sdk/models/file_comment.py +191 -0
  48. files_sdk/models/file_comment_reaction.py +125 -0
  49. files_sdk/models/file_migration.py +69 -0
  50. files_sdk/models/file_migration_log.py +78 -0
  51. files_sdk/models/file_upload_part.py +54 -0
  52. files_sdk/models/folder.py +154 -0
  53. files_sdk/models/form_field.py +43 -0
  54. files_sdk/models/form_field_set.py +240 -0
  55. files_sdk/models/ftp_action_log.py +87 -0
  56. files_sdk/models/gpg_key.py +254 -0
  57. files_sdk/models/group.py +276 -0
  58. files_sdk/models/group_user.py +231 -0
  59. files_sdk/models/history.py +236 -0
  60. files_sdk/models/history_export.py +238 -0
  61. files_sdk/models/history_export_result.py +98 -0
  62. files_sdk/models/image.py +37 -0
  63. files_sdk/models/inbox_recipient.py +118 -0
  64. files_sdk/models/inbox_registration.py +79 -0
  65. files_sdk/models/inbox_upload.py +80 -0
  66. files_sdk/models/invoice.py +91 -0
  67. files_sdk/models/invoice_line_item.py +46 -0
  68. files_sdk/models/ip_address.py +119 -0
  69. files_sdk/models/lock.py +158 -0
  70. files_sdk/models/message.py +244 -0
  71. files_sdk/models/message_comment.py +223 -0
  72. files_sdk/models/message_comment_reaction.py +181 -0
  73. files_sdk/models/message_reaction.py +170 -0
  74. files_sdk/models/notification.py +357 -0
  75. files_sdk/models/outbound_connection_log.py +88 -0
  76. files_sdk/models/payment.py +91 -0
  77. files_sdk/models/payment_line_item.py +42 -0
  78. files_sdk/models/permission.py +174 -0
  79. files_sdk/models/preview.py +40 -0
  80. files_sdk/models/priority.py +63 -0
  81. files_sdk/models/project.py +205 -0
  82. files_sdk/models/public_hosting_request_log.py +82 -0
  83. files_sdk/models/public_ip_address.py +42 -0
  84. files_sdk/models/public_key.py +212 -0
  85. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  86. files_sdk/models/remote_server.py +1677 -0
  87. files_sdk/models/remote_server_configuration_file.py +72 -0
  88. files_sdk/models/request.py +180 -0
  89. files_sdk/models/restore.py +104 -0
  90. files_sdk/models/session.py +100 -0
  91. files_sdk/models/settings_change.py +71 -0
  92. files_sdk/models/sftp_action_log.py +91 -0
  93. files_sdk/models/sftp_host_key.py +215 -0
  94. files_sdk/models/share_group.py +228 -0
  95. files_sdk/models/share_group_member.py +41 -0
  96. files_sdk/models/siem_http_destination.py +773 -0
  97. files_sdk/models/site.py +767 -0
  98. files_sdk/models/snapshot.py +255 -0
  99. files_sdk/models/sso_strategy.py +167 -0
  100. files_sdk/models/status.py +42 -0
  101. files_sdk/models/style.py +152 -0
  102. files_sdk/models/sync_log.py +75 -0
  103. files_sdk/models/usage_by_top_level_dir.py +41 -0
  104. files_sdk/models/usage_daily_snapshot.py +93 -0
  105. files_sdk/models/usage_snapshot.py +73 -0
  106. files_sdk/models/user.py +893 -0
  107. files_sdk/models/user_cipher_use.py +68 -0
  108. files_sdk/models/user_request.py +166 -0
  109. files_sdk/models/user_sftp_client_use.py +68 -0
  110. files_sdk/models/web_dav_action_log.py +87 -0
  111. files_sdk/models/webhook_test.py +104 -0
  112. files_sdk/path_util.py +42 -0
  113. files_sdk/util.py +34 -0
@@ -0,0 +1,691 @@
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 Automation:
12
+ default_attributes = {
13
+ "id": None, # int64 - Automation ID
14
+ "always_overwrite_size_matching_files": None, # boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage. This setting has no effect unless `overwrite_files` is also set to `true`.
15
+ "automation": None, # string - Automation type
16
+ "deleted": None, # boolean - Indicates if the automation has been deleted.
17
+ "description": None, # string - Description for the this Automation.
18
+ "destination_replace_from": None, # string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
19
+ "destination_replace_to": None, # string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
20
+ "destinations": None, # array(string) - Destination Paths
21
+ "disabled": None, # boolean - If true, this automation will not run.
22
+ "exclude_pattern": None, # string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
23
+ "import_urls": None, # array(object) - List of URLs to be imported and names to be used.
24
+ "flatten_destination_structure": None, # boolean - Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
25
+ "group_ids": None, # array(int64) - IDs of Groups for the Automation (i.e. who to Request File from)
26
+ "ignore_locked_folders": None, # boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
27
+ "interval": None, # string - If trigger is `daily`, this specifies how often to run this automation. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
28
+ "last_modified_at": None, # date-time - Time when automation was last modified. Does not change for name or description updates.
29
+ "legacy_folder_matching": None, # boolean - If `true`, use the legacy behavior for this automation, where it can operate on folders in addition to just files. This behavior no longer works and should not be used.
30
+ "name": None, # string - Name for this automation.
31
+ "overwrite_files": None, # boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten on Copy automations if they appear to be the same file size as the newly incoming file. Use the `always_overwrite_size_matching_files` option in conjunction with `overwrite_files` to override this behavior and overwrite files no matter what.
32
+ "path": None, # string - Path on which this Automation runs. Supports globs, except on remote mounts. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
33
+ "path_time_zone": None, # string - Timezone to use when rendering timestamps in paths.
34
+ "recurring_day": None, # int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
35
+ "retry_on_failure_interval_in_minutes": None, # int64 - If the Automation fails, retry at this interval (in minutes). Acceptable values are 5 through 1440 (one day). Set to null to disable.
36
+ "retry_on_failure_number_of_attempts": None, # int64 - If the Automation fails, retry at most this many times. Maximum allowed value: 10. Set to null to disable.
37
+ "schedule": None, # object - If trigger is `custom_schedule`, Custom schedule description for when the automation should be run in json format.
38
+ "human_readable_schedule": None, # string - If trigger is `custom_schedule`, Human readable Custom schedule description for when the automation should be run.
39
+ "schedule_days_of_week": None, # array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the automation should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
40
+ "schedule_times_of_day": None, # array(string) - If trigger is `custom_schedule`, Custom schedule description for when the automation should be run. Times of day in HH:MM format.
41
+ "schedule_time_zone": None, # string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the automation should be run.
42
+ "source": None, # string - Source path/glob. See Automation docs for exact description, but this is used to filter for files in the `path` to find files to operate on. Supports globs, except on remote mounts.
43
+ "sync_ids": None, # array(int64) - IDs of remote sync folder behaviors to run by this Automation
44
+ "trigger_actions": None, # array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
45
+ "trigger": None, # string - How this automation is triggered to run.
46
+ "user_id": None, # int64 - User ID of the Automation's creator.
47
+ "user_ids": None, # array(int64) - IDs of Users for the Automation (i.e. who to Request File from)
48
+ "value": None, # object - A Hash of attributes specific to the automation type.
49
+ "webhook_url": None, # string - If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
50
+ }
51
+
52
+ def __init__(self, attributes=None, options=None):
53
+ if not isinstance(attributes, dict):
54
+ attributes = {}
55
+ if not isinstance(options, dict):
56
+ options = {}
57
+ self.set_attributes(attributes)
58
+ self.options = options
59
+
60
+ def set_attributes(self, attributes):
61
+ for attribute, default_value in Automation.default_attributes.items():
62
+ setattr(self, attribute, attributes.get(attribute, default_value))
63
+
64
+ def get_attributes(self):
65
+ return {
66
+ k: getattr(self, k, None)
67
+ for k in Automation.default_attributes
68
+ if getattr(self, k, None) is not None
69
+ }
70
+
71
+ # Manually Run Automation
72
+ def manual_run(self, params=None):
73
+ if not isinstance(params, dict):
74
+ params = {}
75
+
76
+ if hasattr(self, "id") and self.id:
77
+ params["id"] = self.id
78
+ else:
79
+ raise MissingParameterError("Current object doesn't have a id")
80
+ if "id" not in params:
81
+ raise MissingParameterError("Parameter missing: id")
82
+ if "id" in params and not isinstance(params["id"], int):
83
+ raise InvalidParameterError("Bad parameter: id must be an int")
84
+ Api.send_request(
85
+ "POST",
86
+ "/automations/{id}/manual_run".format(id=params["id"]),
87
+ params,
88
+ self.options,
89
+ )
90
+
91
+ # Parameters:
92
+ # source - string - Source path/glob. See Automation docs for exact description, but this is used to filter for files in the `path` to find files to operate on. Supports globs, except on remote mounts.
93
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
94
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
95
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
96
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
97
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
98
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
99
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
100
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
101
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`. A list of days of the week to run this automation. 0 is Sunday, 1 is Monday, etc.
102
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`. A list of times of day to run this automation. 24-hour time format.
103
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
104
+ # always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage. This setting has no effect unless `overwrite_files` is also set to `true`.
105
+ # description - string - Description for the this Automation.
106
+ # disabled - boolean - If true, this automation will not run.
107
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
108
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
109
+ # flatten_destination_structure - boolean - Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
110
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
111
+ # legacy_folder_matching - boolean - DEPRECATED: If `true`, use the legacy behavior for this automation, where it can operate on folders in addition to just files. This behavior no longer works and should not be used.
112
+ # name - string - Name for this automation.
113
+ # overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten on Copy automations if they appear to be the same file size as the newly incoming file. Use the `always_overwrite_size_matching_files` option in conjunction with `overwrite_files` to override this behavior and overwrite files no matter what.
114
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
115
+ # retry_on_failure_interval_in_minutes - int64 - If the Automation fails, retry at this interval (in minutes). Acceptable values are 5 through 1440 (one day). Set to null to disable.
116
+ # retry_on_failure_number_of_attempts - int64 - If the Automation fails, retry at most this many times. Maximum allowed value: 10. Set to null to disable.
117
+ # trigger - string - How this automation is triggered to run.
118
+ # trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
119
+ # value - object - A Hash of attributes specific to the automation type.
120
+ # recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
121
+ # automation - string - Automation type
122
+ def update(self, params=None):
123
+ if not isinstance(params, dict):
124
+ params = {}
125
+
126
+ if hasattr(self, "id") and self.id:
127
+ params["id"] = self.id
128
+ else:
129
+ raise MissingParameterError("Current object doesn't have a id")
130
+ if "id" not in params:
131
+ raise MissingParameterError("Parameter missing: id")
132
+ if "id" in params and not isinstance(params["id"], int):
133
+ raise InvalidParameterError("Bad parameter: id must be an int")
134
+ if "source" in params and not isinstance(params["source"], str):
135
+ raise InvalidParameterError("Bad parameter: source must be an str")
136
+ if "destinations" in params and not isinstance(
137
+ params["destinations"], builtins.list
138
+ ):
139
+ raise InvalidParameterError(
140
+ "Bad parameter: destinations must be an list"
141
+ )
142
+ if "destination_replace_from" in params and not isinstance(
143
+ params["destination_replace_from"], str
144
+ ):
145
+ raise InvalidParameterError(
146
+ "Bad parameter: destination_replace_from must be an str"
147
+ )
148
+ if "destination_replace_to" in params and not isinstance(
149
+ params["destination_replace_to"], str
150
+ ):
151
+ raise InvalidParameterError(
152
+ "Bad parameter: destination_replace_to must be an str"
153
+ )
154
+ if "interval" in params and not isinstance(params["interval"], str):
155
+ raise InvalidParameterError(
156
+ "Bad parameter: interval must be an str"
157
+ )
158
+ if "path" in params and not isinstance(params["path"], str):
159
+ raise InvalidParameterError("Bad parameter: path must be an str")
160
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
161
+ raise InvalidParameterError(
162
+ "Bad parameter: sync_ids must be an str"
163
+ )
164
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
165
+ raise InvalidParameterError(
166
+ "Bad parameter: user_ids must be an str"
167
+ )
168
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
169
+ raise InvalidParameterError(
170
+ "Bad parameter: group_ids must be an str"
171
+ )
172
+ if "schedule_days_of_week" in params and not isinstance(
173
+ params["schedule_days_of_week"], builtins.list
174
+ ):
175
+ raise InvalidParameterError(
176
+ "Bad parameter: schedule_days_of_week must be an list"
177
+ )
178
+ if "schedule_times_of_day" in params and not isinstance(
179
+ params["schedule_times_of_day"], builtins.list
180
+ ):
181
+ raise InvalidParameterError(
182
+ "Bad parameter: schedule_times_of_day must be an list"
183
+ )
184
+ if "schedule_time_zone" in params and not isinstance(
185
+ params["schedule_time_zone"], str
186
+ ):
187
+ raise InvalidParameterError(
188
+ "Bad parameter: schedule_time_zone must be an str"
189
+ )
190
+ if "description" in params and not isinstance(
191
+ params["description"], str
192
+ ):
193
+ raise InvalidParameterError(
194
+ "Bad parameter: description must be an str"
195
+ )
196
+ if "exclude_pattern" in params and not isinstance(
197
+ params["exclude_pattern"], str
198
+ ):
199
+ raise InvalidParameterError(
200
+ "Bad parameter: exclude_pattern must be an str"
201
+ )
202
+ if "import_urls" in params and not isinstance(
203
+ params["import_urls"], builtins.list
204
+ ):
205
+ raise InvalidParameterError(
206
+ "Bad parameter: import_urls must be an list"
207
+ )
208
+ if "name" in params and not isinstance(params["name"], str):
209
+ raise InvalidParameterError("Bad parameter: name must be an str")
210
+ if "path_time_zone" in params and not isinstance(
211
+ params["path_time_zone"], str
212
+ ):
213
+ raise InvalidParameterError(
214
+ "Bad parameter: path_time_zone must be an str"
215
+ )
216
+ if (
217
+ "retry_on_failure_interval_in_minutes" in params
218
+ and not isinstance(
219
+ params["retry_on_failure_interval_in_minutes"], int
220
+ )
221
+ ):
222
+ raise InvalidParameterError(
223
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
224
+ )
225
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
226
+ params["retry_on_failure_number_of_attempts"], int
227
+ ):
228
+ raise InvalidParameterError(
229
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
230
+ )
231
+ if "trigger" in params and not isinstance(params["trigger"], str):
232
+ raise InvalidParameterError(
233
+ "Bad parameter: trigger must be an str"
234
+ )
235
+ if "trigger_actions" in params and not isinstance(
236
+ params["trigger_actions"], builtins.list
237
+ ):
238
+ raise InvalidParameterError(
239
+ "Bad parameter: trigger_actions must be an list"
240
+ )
241
+ if "recurring_day" in params and not isinstance(
242
+ params["recurring_day"], int
243
+ ):
244
+ raise InvalidParameterError(
245
+ "Bad parameter: recurring_day must be an int"
246
+ )
247
+ if "automation" in params and not isinstance(
248
+ params["automation"], str
249
+ ):
250
+ raise InvalidParameterError(
251
+ "Bad parameter: automation must be an str"
252
+ )
253
+ response, _options = Api.send_request(
254
+ "PATCH",
255
+ "/automations/{id}".format(id=params["id"]),
256
+ params,
257
+ self.options,
258
+ )
259
+ return response.data
260
+
261
+ def delete(self, params=None):
262
+ if not isinstance(params, dict):
263
+ params = {}
264
+
265
+ if hasattr(self, "id") and self.id:
266
+ params["id"] = self.id
267
+ else:
268
+ raise MissingParameterError("Current object doesn't have a id")
269
+ if "id" not in params:
270
+ raise MissingParameterError("Parameter missing: id")
271
+ if "id" in params and not isinstance(params["id"], int):
272
+ raise InvalidParameterError("Bad parameter: id must be an int")
273
+ Api.send_request(
274
+ "DELETE",
275
+ "/automations/{id}".format(id=params["id"]),
276
+ params,
277
+ self.options,
278
+ )
279
+
280
+ def destroy(self, params=None):
281
+ self.delete(params)
282
+
283
+ def save(self):
284
+ if hasattr(self, "id") and self.id:
285
+ new_obj = self.update(self.get_attributes())
286
+ self.set_attributes(new_obj.get_attributes())
287
+ return True
288
+ else:
289
+ new_obj = create(self.get_attributes(), self.options)
290
+ self.set_attributes(new_obj.get_attributes())
291
+ return True
292
+
293
+
294
+ # Parameters:
295
+ # 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.
296
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
297
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation`, `disabled`, `last_modified_at` or `name`.
298
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled`, `last_modified_at` or `automation`. Valid field combinations are `[ disabled, last_modified_at ]`, `[ automation, disabled ]`, `[ automation, last_modified_at ]` or `[ automation, disabled, last_modified_at ]`.
299
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `last_modified_at`.
300
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `last_modified_at`.
301
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `last_modified_at`.
302
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `last_modified_at`.
303
+ def list(params=None, options=None):
304
+ if not isinstance(params, dict):
305
+ params = {}
306
+ if not isinstance(options, dict):
307
+ options = {}
308
+ if "cursor" in params and not isinstance(params["cursor"], str):
309
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
310
+ if "per_page" in params and not isinstance(params["per_page"], int):
311
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
312
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
313
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
314
+ if "filter" in params and not isinstance(params["filter"], dict):
315
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
316
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
317
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
318
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
319
+ raise InvalidParameterError(
320
+ "Bad parameter: filter_gteq must be an dict"
321
+ )
322
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
323
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
324
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
325
+ raise InvalidParameterError(
326
+ "Bad parameter: filter_lteq must be an dict"
327
+ )
328
+ return ListObj(Automation, "GET", "/automations", params, options)
329
+
330
+
331
+ def all(params=None, options=None):
332
+ list(params, options)
333
+
334
+
335
+ # Parameters:
336
+ # id (required) - int64 - Automation ID.
337
+ def find(id, params=None, options=None):
338
+ if not isinstance(params, dict):
339
+ params = {}
340
+ if not isinstance(options, dict):
341
+ options = {}
342
+ params["id"] = id
343
+ if "id" in params and not isinstance(params["id"], int):
344
+ raise InvalidParameterError("Bad parameter: id must be an int")
345
+ if "id" not in params:
346
+ raise MissingParameterError("Parameter missing: id")
347
+ response, options = Api.send_request(
348
+ "GET", "/automations/{id}".format(id=params["id"]), params, options
349
+ )
350
+ return Automation(response.data, options)
351
+
352
+
353
+ def get(id, params=None, options=None):
354
+ find(id, params, options)
355
+
356
+
357
+ # Parameters:
358
+ # source - string - Source path/glob. See Automation docs for exact description, but this is used to filter for files in the `path` to find files to operate on. Supports globs, except on remote mounts.
359
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
360
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
361
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
362
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
363
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
364
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
365
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
366
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
367
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`. A list of days of the week to run this automation. 0 is Sunday, 1 is Monday, etc.
368
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`. A list of times of day to run this automation. 24-hour time format.
369
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
370
+ # always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage. This setting has no effect unless `overwrite_files` is also set to `true`.
371
+ # description - string - Description for the this Automation.
372
+ # disabled - boolean - If true, this automation will not run.
373
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
374
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
375
+ # flatten_destination_structure - boolean - Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
376
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
377
+ # legacy_folder_matching - boolean - DEPRECATED: If `true`, use the legacy behavior for this automation, where it can operate on folders in addition to just files. This behavior no longer works and should not be used.
378
+ # name - string - Name for this automation.
379
+ # overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten on Copy automations if they appear to be the same file size as the newly incoming file. Use the `always_overwrite_size_matching_files` option in conjunction with `overwrite_files` to override this behavior and overwrite files no matter what.
380
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
381
+ # retry_on_failure_interval_in_minutes - int64 - If the Automation fails, retry at this interval (in minutes). Acceptable values are 5 through 1440 (one day). Set to null to disable.
382
+ # retry_on_failure_number_of_attempts - int64 - If the Automation fails, retry at most this many times. Maximum allowed value: 10. Set to null to disable.
383
+ # trigger - string - How this automation is triggered to run.
384
+ # trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
385
+ # value - object - A Hash of attributes specific to the automation type.
386
+ # recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
387
+ # automation (required) - string - Automation type
388
+ def create(params=None, options=None):
389
+ if not isinstance(params, dict):
390
+ params = {}
391
+ if not isinstance(options, dict):
392
+ options = {}
393
+ if "source" in params and not isinstance(params["source"], str):
394
+ raise InvalidParameterError("Bad parameter: source must be an str")
395
+ if "destinations" in params and not isinstance(
396
+ params["destinations"], builtins.list
397
+ ):
398
+ raise InvalidParameterError(
399
+ "Bad parameter: destinations must be an list"
400
+ )
401
+ if "destination_replace_from" in params and not isinstance(
402
+ params["destination_replace_from"], str
403
+ ):
404
+ raise InvalidParameterError(
405
+ "Bad parameter: destination_replace_from must be an str"
406
+ )
407
+ if "destination_replace_to" in params and not isinstance(
408
+ params["destination_replace_to"], str
409
+ ):
410
+ raise InvalidParameterError(
411
+ "Bad parameter: destination_replace_to must be an str"
412
+ )
413
+ if "interval" in params and not isinstance(params["interval"], str):
414
+ raise InvalidParameterError("Bad parameter: interval must be an str")
415
+ if "path" in params and not isinstance(params["path"], str):
416
+ raise InvalidParameterError("Bad parameter: path must be an str")
417
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
418
+ raise InvalidParameterError("Bad parameter: sync_ids must be an str")
419
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
420
+ raise InvalidParameterError("Bad parameter: user_ids must be an str")
421
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
422
+ raise InvalidParameterError("Bad parameter: group_ids must be an str")
423
+ if "schedule_days_of_week" in params and not isinstance(
424
+ params["schedule_days_of_week"], builtins.list
425
+ ):
426
+ raise InvalidParameterError(
427
+ "Bad parameter: schedule_days_of_week must be an list"
428
+ )
429
+ if "schedule_times_of_day" in params and not isinstance(
430
+ params["schedule_times_of_day"], builtins.list
431
+ ):
432
+ raise InvalidParameterError(
433
+ "Bad parameter: schedule_times_of_day must be an list"
434
+ )
435
+ if "schedule_time_zone" in params and not isinstance(
436
+ params["schedule_time_zone"], str
437
+ ):
438
+ raise InvalidParameterError(
439
+ "Bad parameter: schedule_time_zone must be an str"
440
+ )
441
+ if "description" in params and not isinstance(params["description"], str):
442
+ raise InvalidParameterError(
443
+ "Bad parameter: description must be an str"
444
+ )
445
+ if "exclude_pattern" in params and not isinstance(
446
+ params["exclude_pattern"], str
447
+ ):
448
+ raise InvalidParameterError(
449
+ "Bad parameter: exclude_pattern must be an str"
450
+ )
451
+ if "import_urls" in params and not isinstance(
452
+ params["import_urls"], builtins.list
453
+ ):
454
+ raise InvalidParameterError(
455
+ "Bad parameter: import_urls must be an list"
456
+ )
457
+ if "name" in params and not isinstance(params["name"], str):
458
+ raise InvalidParameterError("Bad parameter: name must be an str")
459
+ if "path_time_zone" in params and not isinstance(
460
+ params["path_time_zone"], str
461
+ ):
462
+ raise InvalidParameterError(
463
+ "Bad parameter: path_time_zone must be an str"
464
+ )
465
+ if "retry_on_failure_interval_in_minutes" in params and not isinstance(
466
+ params["retry_on_failure_interval_in_minutes"], int
467
+ ):
468
+ raise InvalidParameterError(
469
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
470
+ )
471
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
472
+ params["retry_on_failure_number_of_attempts"], int
473
+ ):
474
+ raise InvalidParameterError(
475
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
476
+ )
477
+ if "trigger" in params and not isinstance(params["trigger"], str):
478
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
479
+ if "trigger_actions" in params and not isinstance(
480
+ params["trigger_actions"], builtins.list
481
+ ):
482
+ raise InvalidParameterError(
483
+ "Bad parameter: trigger_actions must be an list"
484
+ )
485
+ if "value" in params and not isinstance(params["value"], dict):
486
+ raise InvalidParameterError("Bad parameter: value must be an dict")
487
+ if "recurring_day" in params and not isinstance(
488
+ params["recurring_day"], int
489
+ ):
490
+ raise InvalidParameterError(
491
+ "Bad parameter: recurring_day must be an int"
492
+ )
493
+ if "automation" in params and not isinstance(params["automation"], str):
494
+ raise InvalidParameterError("Bad parameter: automation must be an str")
495
+ if "automation" not in params:
496
+ raise MissingParameterError("Parameter missing: automation")
497
+ response, options = Api.send_request(
498
+ "POST", "/automations", params, options
499
+ )
500
+ return Automation(response.data, options)
501
+
502
+
503
+ # Manually Run Automation
504
+ def manual_run(id, params=None, options=None):
505
+ if not isinstance(params, dict):
506
+ params = {}
507
+ if not isinstance(options, dict):
508
+ options = {}
509
+ params["id"] = id
510
+ if "id" in params and not isinstance(params["id"], int):
511
+ raise InvalidParameterError("Bad parameter: id must be an int")
512
+ if "id" not in params:
513
+ raise MissingParameterError("Parameter missing: id")
514
+ Api.send_request(
515
+ "POST",
516
+ "/automations/{id}/manual_run".format(id=params["id"]),
517
+ params,
518
+ options,
519
+ )
520
+
521
+
522
+ # Parameters:
523
+ # source - string - Source path/glob. See Automation docs for exact description, but this is used to filter for files in the `path` to find files to operate on. Supports globs, except on remote mounts.
524
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
525
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
526
+ # destination_replace_to - string - If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
527
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
528
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
529
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
530
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
531
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
532
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`. A list of days of the week to run this automation. 0 is Sunday, 1 is Monday, etc.
533
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`. A list of times of day to run this automation. 24-hour time format.
534
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
535
+ # always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage. This setting has no effect unless `overwrite_files` is also set to `true`.
536
+ # description - string - Description for the this Automation.
537
+ # disabled - boolean - If true, this automation will not run.
538
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
539
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
540
+ # flatten_destination_structure - boolean - Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
541
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
542
+ # legacy_folder_matching - boolean - DEPRECATED: If `true`, use the legacy behavior for this automation, where it can operate on folders in addition to just files. This behavior no longer works and should not be used.
543
+ # name - string - Name for this automation.
544
+ # overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten on Copy automations if they appear to be the same file size as the newly incoming file. Use the `always_overwrite_size_matching_files` option in conjunction with `overwrite_files` to override this behavior and overwrite files no matter what.
545
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
546
+ # retry_on_failure_interval_in_minutes - int64 - If the Automation fails, retry at this interval (in minutes). Acceptable values are 5 through 1440 (one day). Set to null to disable.
547
+ # retry_on_failure_number_of_attempts - int64 - If the Automation fails, retry at most this many times. Maximum allowed value: 10. Set to null to disable.
548
+ # trigger - string - How this automation is triggered to run.
549
+ # trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
550
+ # value - object - A Hash of attributes specific to the automation type.
551
+ # recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
552
+ # automation - string - Automation type
553
+ def update(id, params=None, options=None):
554
+ if not isinstance(params, dict):
555
+ params = {}
556
+ if not isinstance(options, dict):
557
+ options = {}
558
+ params["id"] = id
559
+ if "id" in params and not isinstance(params["id"], int):
560
+ raise InvalidParameterError("Bad parameter: id must be an int")
561
+ if "source" in params and not isinstance(params["source"], str):
562
+ raise InvalidParameterError("Bad parameter: source must be an str")
563
+ if "destinations" in params and not isinstance(
564
+ params["destinations"], builtins.list
565
+ ):
566
+ raise InvalidParameterError(
567
+ "Bad parameter: destinations must be an list"
568
+ )
569
+ if "destination_replace_from" in params and not isinstance(
570
+ params["destination_replace_from"], str
571
+ ):
572
+ raise InvalidParameterError(
573
+ "Bad parameter: destination_replace_from must be an str"
574
+ )
575
+ if "destination_replace_to" in params and not isinstance(
576
+ params["destination_replace_to"], str
577
+ ):
578
+ raise InvalidParameterError(
579
+ "Bad parameter: destination_replace_to must be an str"
580
+ )
581
+ if "interval" in params and not isinstance(params["interval"], str):
582
+ raise InvalidParameterError("Bad parameter: interval must be an str")
583
+ if "path" in params and not isinstance(params["path"], str):
584
+ raise InvalidParameterError("Bad parameter: path must be an str")
585
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
586
+ raise InvalidParameterError("Bad parameter: sync_ids must be an str")
587
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
588
+ raise InvalidParameterError("Bad parameter: user_ids must be an str")
589
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
590
+ raise InvalidParameterError("Bad parameter: group_ids must be an str")
591
+ if "schedule_days_of_week" in params and not isinstance(
592
+ params["schedule_days_of_week"], builtins.list
593
+ ):
594
+ raise InvalidParameterError(
595
+ "Bad parameter: schedule_days_of_week must be an list"
596
+ )
597
+ if "schedule_times_of_day" in params and not isinstance(
598
+ params["schedule_times_of_day"], builtins.list
599
+ ):
600
+ raise InvalidParameterError(
601
+ "Bad parameter: schedule_times_of_day must be an list"
602
+ )
603
+ if "schedule_time_zone" in params and not isinstance(
604
+ params["schedule_time_zone"], str
605
+ ):
606
+ raise InvalidParameterError(
607
+ "Bad parameter: schedule_time_zone must be an str"
608
+ )
609
+ if "description" in params and not isinstance(params["description"], str):
610
+ raise InvalidParameterError(
611
+ "Bad parameter: description must be an str"
612
+ )
613
+ if "exclude_pattern" in params and not isinstance(
614
+ params["exclude_pattern"], str
615
+ ):
616
+ raise InvalidParameterError(
617
+ "Bad parameter: exclude_pattern must be an str"
618
+ )
619
+ if "import_urls" in params and not isinstance(
620
+ params["import_urls"], builtins.list
621
+ ):
622
+ raise InvalidParameterError(
623
+ "Bad parameter: import_urls must be an list"
624
+ )
625
+ if "name" in params and not isinstance(params["name"], str):
626
+ raise InvalidParameterError("Bad parameter: name must be an str")
627
+ if "path_time_zone" in params and not isinstance(
628
+ params["path_time_zone"], str
629
+ ):
630
+ raise InvalidParameterError(
631
+ "Bad parameter: path_time_zone must be an str"
632
+ )
633
+ if "retry_on_failure_interval_in_minutes" in params and not isinstance(
634
+ params["retry_on_failure_interval_in_minutes"], int
635
+ ):
636
+ raise InvalidParameterError(
637
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
638
+ )
639
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
640
+ params["retry_on_failure_number_of_attempts"], int
641
+ ):
642
+ raise InvalidParameterError(
643
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
644
+ )
645
+ if "trigger" in params and not isinstance(params["trigger"], str):
646
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
647
+ if "trigger_actions" in params and not isinstance(
648
+ params["trigger_actions"], builtins.list
649
+ ):
650
+ raise InvalidParameterError(
651
+ "Bad parameter: trigger_actions must be an list"
652
+ )
653
+ if "value" in params and not isinstance(params["value"], dict):
654
+ raise InvalidParameterError("Bad parameter: value must be an dict")
655
+ if "recurring_day" in params and not isinstance(
656
+ params["recurring_day"], int
657
+ ):
658
+ raise InvalidParameterError(
659
+ "Bad parameter: recurring_day must be an int"
660
+ )
661
+ if "automation" in params and not isinstance(params["automation"], str):
662
+ raise InvalidParameterError("Bad parameter: automation must be an str")
663
+ if "id" not in params:
664
+ raise MissingParameterError("Parameter missing: id")
665
+ response, options = Api.send_request(
666
+ "PATCH", "/automations/{id}".format(id=params["id"]), params, options
667
+ )
668
+ return Automation(response.data, options)
669
+
670
+
671
+ def delete(id, params=None, options=None):
672
+ if not isinstance(params, dict):
673
+ params = {}
674
+ if not isinstance(options, dict):
675
+ options = {}
676
+ params["id"] = id
677
+ if "id" in params and not isinstance(params["id"], int):
678
+ raise InvalidParameterError("Bad parameter: id must be an int")
679
+ if "id" not in params:
680
+ raise MissingParameterError("Parameter missing: id")
681
+ Api.send_request(
682
+ "DELETE", "/automations/{id}".format(id=params["id"]), params, options
683
+ )
684
+
685
+
686
+ def destroy(id, params=None, options=None):
687
+ delete(id, params, options)
688
+
689
+
690
+ def new(*args, **kwargs):
691
+ return Automation(*args, **kwargs)