files-com 1.6.208__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of files-com might be problematic. Click here for more details.

Files changed (126) hide show
  1. README.md +758 -0
  2. _VERSION +1 -0
  3. files_com-1.6.208.dist-info/METADATA +770 -0
  4. files_com-1.6.208.dist-info/RECORD +126 -0
  5. files_com-1.6.208.dist-info/WHEEL +5 -0
  6. files_com-1.6.208.dist-info/licenses/LICENSE +21 -0
  7. files_com-1.6.208.dist-info/top_level.txt +1 -0
  8. files_sdk/__init__.py +309 -0
  9. files_sdk/api.py +63 -0
  10. files_sdk/api_client.py +336 -0
  11. files_sdk/error.py +2981 -0
  12. files_sdk/list_obj.py +42 -0
  13. files_sdk/models/__init__.py +119 -0
  14. files_sdk/models/account_line_item.py +51 -0
  15. files_sdk/models/action.py +49 -0
  16. files_sdk/models/action_notification_export.py +153 -0
  17. files_sdk/models/action_notification_export_result.py +88 -0
  18. files_sdk/models/agent_push_update.py +44 -0
  19. files_sdk/models/api_key.py +318 -0
  20. files_sdk/models/api_request_log.py +105 -0
  21. files_sdk/models/app.py +89 -0
  22. files_sdk/models/as2_incoming_message.py +117 -0
  23. files_sdk/models/as2_outgoing_message.py +113 -0
  24. files_sdk/models/as2_partner.py +415 -0
  25. files_sdk/models/as2_station.py +282 -0
  26. files_sdk/models/auto.py +36 -0
  27. files_sdk/models/automation.py +823 -0
  28. files_sdk/models/automation_log.py +94 -0
  29. files_sdk/models/automation_run.py +112 -0
  30. files_sdk/models/bandwidth_snapshot.py +91 -0
  31. files_sdk/models/behavior.py +340 -0
  32. files_sdk/models/bundle.py +686 -0
  33. files_sdk/models/bundle_action.py +93 -0
  34. files_sdk/models/bundle_download.py +94 -0
  35. files_sdk/models/bundle_notification.py +252 -0
  36. files_sdk/models/bundle_path.py +37 -0
  37. files_sdk/models/bundle_recipient.py +133 -0
  38. files_sdk/models/bundle_registration.py +82 -0
  39. files_sdk/models/child_site_management_policy.py +278 -0
  40. files_sdk/models/clickwrap.py +268 -0
  41. files_sdk/models/dns_record.py +59 -0
  42. files_sdk/models/email_incoming_message.py +102 -0
  43. files_sdk/models/email_log.py +84 -0
  44. files_sdk/models/errors.py +37 -0
  45. files_sdk/models/exavault_api_request_log.py +102 -0
  46. files_sdk/models/external_event.py +148 -0
  47. files_sdk/models/file.py +851 -0
  48. files_sdk/models/file_action.py +39 -0
  49. files_sdk/models/file_comment.py +191 -0
  50. files_sdk/models/file_comment_reaction.py +125 -0
  51. files_sdk/models/file_migration.py +69 -0
  52. files_sdk/models/file_migration_log.py +88 -0
  53. files_sdk/models/file_upload_part.py +54 -0
  54. files_sdk/models/folder.py +186 -0
  55. files_sdk/models/form_field.py +43 -0
  56. files_sdk/models/form_field_set.py +265 -0
  57. files_sdk/models/ftp_action_log.py +104 -0
  58. files_sdk/models/gpg_key.py +333 -0
  59. files_sdk/models/group.py +338 -0
  60. files_sdk/models/group_user.py +235 -0
  61. files_sdk/models/history.py +236 -0
  62. files_sdk/models/history_export.py +238 -0
  63. files_sdk/models/history_export_result.py +98 -0
  64. files_sdk/models/holiday_region.py +58 -0
  65. files_sdk/models/image.py +37 -0
  66. files_sdk/models/inbound_s3_log.py +95 -0
  67. files_sdk/models/inbox_recipient.py +124 -0
  68. files_sdk/models/inbox_registration.py +79 -0
  69. files_sdk/models/inbox_upload.py +80 -0
  70. files_sdk/models/invoice.py +91 -0
  71. files_sdk/models/invoice_line_item.py +51 -0
  72. files_sdk/models/ip_address.py +119 -0
  73. files_sdk/models/key_lifecycle_rule.py +243 -0
  74. files_sdk/models/lock.py +174 -0
  75. files_sdk/models/message.py +244 -0
  76. files_sdk/models/message_comment.py +223 -0
  77. files_sdk/models/message_comment_reaction.py +181 -0
  78. files_sdk/models/message_reaction.py +170 -0
  79. files_sdk/models/notification.py +451 -0
  80. files_sdk/models/outbound_connection_log.py +105 -0
  81. files_sdk/models/partner.py +307 -0
  82. files_sdk/models/payment.py +91 -0
  83. files_sdk/models/payment_line_item.py +42 -0
  84. files_sdk/models/permission.py +190 -0
  85. files_sdk/models/preview.py +40 -0
  86. files_sdk/models/priority.py +63 -0
  87. files_sdk/models/project.py +205 -0
  88. files_sdk/models/public_hosting_request_log.py +101 -0
  89. files_sdk/models/public_ip_address.py +42 -0
  90. files_sdk/models/public_key.py +269 -0
  91. files_sdk/models/remote_bandwidth_snapshot.py +91 -0
  92. files_sdk/models/remote_mount_backend.py +438 -0
  93. files_sdk/models/remote_server.py +1854 -0
  94. files_sdk/models/remote_server_configuration_file.py +73 -0
  95. files_sdk/models/remote_server_credential.py +855 -0
  96. files_sdk/models/request.py +184 -0
  97. files_sdk/models/restore.py +142 -0
  98. files_sdk/models/scim_log.py +88 -0
  99. files_sdk/models/session.py +100 -0
  100. files_sdk/models/settings_change.py +71 -0
  101. files_sdk/models/sftp_action_log.py +108 -0
  102. files_sdk/models/sftp_host_key.py +215 -0
  103. files_sdk/models/share_group.py +228 -0
  104. files_sdk/models/share_group_member.py +41 -0
  105. files_sdk/models/siem_http_destination.py +1074 -0
  106. files_sdk/models/site.py +1289 -0
  107. files_sdk/models/snapshot.py +255 -0
  108. files_sdk/models/sso_strategy.py +168 -0
  109. files_sdk/models/status.py +42 -0
  110. files_sdk/models/style.py +152 -0
  111. files_sdk/models/sync.py +588 -0
  112. files_sdk/models/sync_log.py +86 -0
  113. files_sdk/models/sync_run.py +124 -0
  114. files_sdk/models/usage_by_top_level_dir.py +41 -0
  115. files_sdk/models/usage_daily_snapshot.py +93 -0
  116. files_sdk/models/usage_snapshot.py +73 -0
  117. files_sdk/models/user.py +1232 -0
  118. files_sdk/models/user_cipher_use.py +91 -0
  119. files_sdk/models/user_lifecycle_rule.py +355 -0
  120. files_sdk/models/user_request.py +166 -0
  121. files_sdk/models/user_sftp_client_use.py +68 -0
  122. files_sdk/models/web_dav_action_log.py +104 -0
  123. files_sdk/models/webhook_test.py +116 -0
  124. files_sdk/models/workspace.py +202 -0
  125. files_sdk/path_util.py +42 -0
  126. files_sdk/util.py +34 -0
@@ -0,0 +1,823 @@
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
+ "workspace_id": None, # int64 - Workspace ID
15
+ "always_serialize_jobs": None, # boolean - Ordinarily, we will allow automation runs to run in parallel for non-scheduled automations. If this flag is `true` we will force automation runs to be serialized (run one at a time, one after another). This can resolve some issues with race conditions on remote systems at the cost of some performance.
16
+ "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`.
17
+ "automation": None, # string - Automation type
18
+ "deleted": None, # boolean - Indicates if the automation has been deleted.
19
+ "description": None, # string - Description for the this Automation.
20
+ "destination_replace_from": None, # string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
21
+ "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.
22
+ "destinations": None, # array(string) - Destination Paths
23
+ "disabled": None, # boolean - If true, this automation will not run.
24
+ "exclude_pattern": None, # string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
25
+ "import_urls": None, # array(object) - List of URLs to be imported and names to be used.
26
+ "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.
27
+ "group_ids": None, # array(int64) - IDs of Groups for the Automation (i.e. who to Request File from)
28
+ "ignore_locked_folders": None, # boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
29
+ "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`
30
+ "last_modified_at": None, # date-time - Time when automation was last modified. Does not change for name or description updates.
31
+ "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.
32
+ "name": None, # string - Name for this automation.
33
+ "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.
34
+ "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.
35
+ "path_time_zone": None, # string - Timezone to use when rendering timestamps in paths.
36
+ "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`.
37
+ "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.
38
+ "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.
39
+ "schedule": None, # object - If trigger is `custom_schedule`, Custom schedule description for when the automation should be run in json format.
40
+ "human_readable_schedule": None, # string - If trigger is `custom_schedule`, Human readable Custom schedule description for when the automation should be run.
41
+ "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.
42
+ "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.
43
+ "schedule_time_zone": None, # string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the automation should be run.
44
+ "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.
45
+ "legacy_sync_ids": None, # array(int64) - IDs of remote sync folder behaviors to run by this Automation
46
+ "sync_ids": None, # array(int64) - IDs of syncs to run by this Automation. This is the new way to specify syncs, and it is recommended to use this instead of `legacy_sync_ids`.
47
+ "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, archived_delete, copy
48
+ "trigger": None, # string - How this automation is triggered to run.
49
+ "user_id": None, # int64 - User ID of the Automation's creator.
50
+ "user_ids": None, # array(int64) - IDs of Users for the Automation (i.e. who to Request File from)
51
+ "value": None, # object - A Hash of attributes specific to the automation type.
52
+ "webhook_url": None, # string - If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
53
+ "holiday_region": None, # string - If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
54
+ }
55
+
56
+ def __init__(self, attributes=None, options=None):
57
+ if not isinstance(attributes, dict):
58
+ attributes = {}
59
+ if not isinstance(options, dict):
60
+ options = {}
61
+ self.set_attributes(attributes)
62
+ self.options = options
63
+
64
+ def set_attributes(self, attributes):
65
+ for attribute, default_value in Automation.default_attributes.items():
66
+ setattr(self, attribute, attributes.get(attribute, default_value))
67
+
68
+ def get_attributes(self):
69
+ return {
70
+ k: getattr(self, k, None)
71
+ for k in Automation.default_attributes
72
+ if getattr(self, k, None) is not None
73
+ }
74
+
75
+ # Manually Run Automation
76
+ def manual_run(self, params=None):
77
+ if not isinstance(params, dict):
78
+ params = {}
79
+
80
+ if hasattr(self, "id") and self.id:
81
+ params["id"] = self.id
82
+ else:
83
+ raise MissingParameterError("Current object doesn't have a id")
84
+ if "id" not in params:
85
+ raise MissingParameterError("Parameter missing: id")
86
+ if "id" in params and not isinstance(params["id"], int):
87
+ raise InvalidParameterError("Bad parameter: id must be an int")
88
+ Api.send_request(
89
+ "POST",
90
+ "/automations/{id}/manual_run".format(id=params["id"]),
91
+ params,
92
+ self.options,
93
+ )
94
+
95
+ # Parameters:
96
+ # 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.
97
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
98
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
99
+ # 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.
100
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
101
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
102
+ # legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
103
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
104
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
105
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
106
+ # 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.
107
+ # 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.
108
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
109
+ # holiday_region - string - If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
110
+ # 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`.
111
+ # always_serialize_jobs - boolean - Ordinarily, we will allow automation runs to run in parallel for non-scheduled automations. If this flag is `true` we will force automation runs to be serialized (run one at a time, one after another). This can resolve some issues with race conditions on remote systems at the cost of some performance.
112
+ # description - string - Description for the this Automation.
113
+ # disabled - boolean - If true, this automation will not run.
114
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
115
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
116
+ # 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.
117
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
118
+ # 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.
119
+ # name - string - Name for this automation.
120
+ # 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.
121
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
122
+ # 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.
123
+ # 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.
124
+ # trigger - string - How this automation is triggered to run.
125
+ # 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, archived_delete, copy
126
+ # value - object - A Hash of attributes specific to the automation type.
127
+ # 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`.
128
+ # automation - string - Automation type
129
+ def update(self, params=None):
130
+ if not isinstance(params, dict):
131
+ params = {}
132
+
133
+ if hasattr(self, "id") and self.id:
134
+ params["id"] = self.id
135
+ else:
136
+ raise MissingParameterError("Current object doesn't have a id")
137
+ if "id" not in params:
138
+ raise MissingParameterError("Parameter missing: id")
139
+ if "id" in params and not isinstance(params["id"], int):
140
+ raise InvalidParameterError("Bad parameter: id must be an int")
141
+ if "source" in params and not isinstance(params["source"], str):
142
+ raise InvalidParameterError("Bad parameter: source must be an str")
143
+ if "destinations" in params and not isinstance(
144
+ params["destinations"], builtins.list
145
+ ):
146
+ raise InvalidParameterError(
147
+ "Bad parameter: destinations must be an list"
148
+ )
149
+ if "destination_replace_from" in params and not isinstance(
150
+ params["destination_replace_from"], str
151
+ ):
152
+ raise InvalidParameterError(
153
+ "Bad parameter: destination_replace_from must be an str"
154
+ )
155
+ if "destination_replace_to" in params and not isinstance(
156
+ params["destination_replace_to"], str
157
+ ):
158
+ raise InvalidParameterError(
159
+ "Bad parameter: destination_replace_to must be an str"
160
+ )
161
+ if "interval" in params and not isinstance(params["interval"], str):
162
+ raise InvalidParameterError(
163
+ "Bad parameter: interval must be an str"
164
+ )
165
+ if "path" in params and not isinstance(params["path"], str):
166
+ raise InvalidParameterError("Bad parameter: path must be an str")
167
+ if "legacy_sync_ids" in params and not isinstance(
168
+ params["legacy_sync_ids"], str
169
+ ):
170
+ raise InvalidParameterError(
171
+ "Bad parameter: legacy_sync_ids must be an str"
172
+ )
173
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
174
+ raise InvalidParameterError(
175
+ "Bad parameter: sync_ids must be an str"
176
+ )
177
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
178
+ raise InvalidParameterError(
179
+ "Bad parameter: user_ids must be an str"
180
+ )
181
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
182
+ raise InvalidParameterError(
183
+ "Bad parameter: group_ids must be an str"
184
+ )
185
+ if "schedule_days_of_week" in params and not isinstance(
186
+ params["schedule_days_of_week"], builtins.list
187
+ ):
188
+ raise InvalidParameterError(
189
+ "Bad parameter: schedule_days_of_week must be an list"
190
+ )
191
+ if "schedule_times_of_day" in params and not isinstance(
192
+ params["schedule_times_of_day"], builtins.list
193
+ ):
194
+ raise InvalidParameterError(
195
+ "Bad parameter: schedule_times_of_day must be an list"
196
+ )
197
+ if "schedule_time_zone" in params and not isinstance(
198
+ params["schedule_time_zone"], str
199
+ ):
200
+ raise InvalidParameterError(
201
+ "Bad parameter: schedule_time_zone must be an str"
202
+ )
203
+ if "holiday_region" in params and not isinstance(
204
+ params["holiday_region"], str
205
+ ):
206
+ raise InvalidParameterError(
207
+ "Bad parameter: holiday_region must be an str"
208
+ )
209
+ if "description" in params and not isinstance(
210
+ params["description"], str
211
+ ):
212
+ raise InvalidParameterError(
213
+ "Bad parameter: description must be an str"
214
+ )
215
+ if "exclude_pattern" in params and not isinstance(
216
+ params["exclude_pattern"], str
217
+ ):
218
+ raise InvalidParameterError(
219
+ "Bad parameter: exclude_pattern must be an str"
220
+ )
221
+ if "import_urls" in params and not isinstance(
222
+ params["import_urls"], builtins.list
223
+ ):
224
+ raise InvalidParameterError(
225
+ "Bad parameter: import_urls must be an list"
226
+ )
227
+ if "name" in params and not isinstance(params["name"], str):
228
+ raise InvalidParameterError("Bad parameter: name must be an str")
229
+ if "path_time_zone" in params and not isinstance(
230
+ params["path_time_zone"], str
231
+ ):
232
+ raise InvalidParameterError(
233
+ "Bad parameter: path_time_zone must be an str"
234
+ )
235
+ if (
236
+ "retry_on_failure_interval_in_minutes" in params
237
+ and not isinstance(
238
+ params["retry_on_failure_interval_in_minutes"], int
239
+ )
240
+ ):
241
+ raise InvalidParameterError(
242
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
243
+ )
244
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
245
+ params["retry_on_failure_number_of_attempts"], int
246
+ ):
247
+ raise InvalidParameterError(
248
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
249
+ )
250
+ if "trigger" in params and not isinstance(params["trigger"], str):
251
+ raise InvalidParameterError(
252
+ "Bad parameter: trigger must be an str"
253
+ )
254
+ if "trigger_actions" in params and not isinstance(
255
+ params["trigger_actions"], builtins.list
256
+ ):
257
+ raise InvalidParameterError(
258
+ "Bad parameter: trigger_actions must be an list"
259
+ )
260
+ if "recurring_day" in params and not isinstance(
261
+ params["recurring_day"], int
262
+ ):
263
+ raise InvalidParameterError(
264
+ "Bad parameter: recurring_day must be an int"
265
+ )
266
+ if "automation" in params and not isinstance(
267
+ params["automation"], str
268
+ ):
269
+ raise InvalidParameterError(
270
+ "Bad parameter: automation must be an str"
271
+ )
272
+ response, _options = Api.send_request(
273
+ "PATCH",
274
+ "/automations/{id}".format(id=params["id"]),
275
+ params,
276
+ self.options,
277
+ )
278
+ return response.data
279
+
280
+ def delete(self, params=None):
281
+ if not isinstance(params, dict):
282
+ params = {}
283
+
284
+ if hasattr(self, "id") and self.id:
285
+ params["id"] = self.id
286
+ else:
287
+ raise MissingParameterError("Current object doesn't have a id")
288
+ if "id" not in params:
289
+ raise MissingParameterError("Parameter missing: id")
290
+ if "id" in params and not isinstance(params["id"], int):
291
+ raise InvalidParameterError("Bad parameter: id must be an int")
292
+ Api.send_request(
293
+ "DELETE",
294
+ "/automations/{id}".format(id=params["id"]),
295
+ params,
296
+ self.options,
297
+ )
298
+
299
+ def destroy(self, params=None):
300
+ self.delete(params)
301
+
302
+ def save(self):
303
+ if hasattr(self, "id") and self.id:
304
+ new_obj = self.update(self.get_attributes())
305
+ self.set_attributes(new_obj.get_attributes())
306
+ return True
307
+ else:
308
+ new_obj = create(self.get_attributes(), self.options)
309
+ self.set_attributes(new_obj.get_attributes())
310
+ return True
311
+
312
+
313
+ # Parameters:
314
+ # 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.
315
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
316
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `name`, `automation`, `last_modified_at` or `disabled`.
317
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled`, `last_modified_at`, `workspace_id` or `automation`. Valid field combinations are `[ disabled, last_modified_at ]`, `[ workspace_id, disabled ]`, `[ disabled, automation ]`, `[ workspace_id, last_modified_at ]`, `[ automation, last_modified_at ]`, `[ workspace_id, automation ]`, `[ workspace_id, disabled, last_modified_at ]`, `[ disabled, automation, last_modified_at ]`, `[ workspace_id, disabled, automation ]`, `[ workspace_id, automation, last_modified_at ]` or `[ workspace_id, disabled, automation, last_modified_at ]`.
318
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `last_modified_at`.
319
+ # 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`.
320
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `last_modified_at`.
321
+ # 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`.
322
+ def list(params=None, options=None):
323
+ if not isinstance(params, dict):
324
+ params = {}
325
+ if not isinstance(options, dict):
326
+ options = {}
327
+ if "cursor" in params and not isinstance(params["cursor"], str):
328
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
329
+ if "per_page" in params and not isinstance(params["per_page"], int):
330
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
331
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
332
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
333
+ if "filter" in params and not isinstance(params["filter"], dict):
334
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
335
+ if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
336
+ raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
337
+ if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
338
+ raise InvalidParameterError(
339
+ "Bad parameter: filter_gteq must be an dict"
340
+ )
341
+ if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
342
+ raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
343
+ if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
344
+ raise InvalidParameterError(
345
+ "Bad parameter: filter_lteq must be an dict"
346
+ )
347
+ return ListObj(Automation, "GET", "/automations", params, options)
348
+
349
+
350
+ def all(params=None, options=None):
351
+ list(params, options)
352
+
353
+
354
+ # Parameters:
355
+ # id (required) - int64 - Automation ID.
356
+ def find(id, params=None, options=None):
357
+ if not isinstance(params, dict):
358
+ params = {}
359
+ if not isinstance(options, dict):
360
+ options = {}
361
+ params["id"] = id
362
+ if "id" in params and not isinstance(params["id"], int):
363
+ raise InvalidParameterError("Bad parameter: id must be an int")
364
+ if "id" not in params:
365
+ raise MissingParameterError("Parameter missing: id")
366
+ response, options = Api.send_request(
367
+ "GET", "/automations/{id}".format(id=params["id"]), params, options
368
+ )
369
+ return Automation(response.data, options)
370
+
371
+
372
+ def get(id, params=None, options=None):
373
+ find(id, params, options)
374
+
375
+
376
+ # Parameters:
377
+ # 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.
378
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
379
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
380
+ # 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.
381
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
382
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
383
+ # legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
384
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
385
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
386
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
387
+ # 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.
388
+ # 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.
389
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
390
+ # holiday_region - string - If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
391
+ # 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`.
392
+ # always_serialize_jobs - boolean - Ordinarily, we will allow automation runs to run in parallel for non-scheduled automations. If this flag is `true` we will force automation runs to be serialized (run one at a time, one after another). This can resolve some issues with race conditions on remote systems at the cost of some performance.
393
+ # description - string - Description for the this Automation.
394
+ # disabled - boolean - If true, this automation will not run.
395
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
396
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
397
+ # 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.
398
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
399
+ # 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.
400
+ # name - string - Name for this automation.
401
+ # 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.
402
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
403
+ # 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.
404
+ # 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.
405
+ # trigger - string - How this automation is triggered to run.
406
+ # 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, archived_delete, copy
407
+ # value - object - A Hash of attributes specific to the automation type.
408
+ # 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`.
409
+ # automation (required) - string - Automation type
410
+ # workspace_id - int64 - Workspace ID
411
+ def create(params=None, options=None):
412
+ if not isinstance(params, dict):
413
+ params = {}
414
+ if not isinstance(options, dict):
415
+ options = {}
416
+ if "source" in params and not isinstance(params["source"], str):
417
+ raise InvalidParameterError("Bad parameter: source must be an str")
418
+ if "destinations" in params and not isinstance(
419
+ params["destinations"], builtins.list
420
+ ):
421
+ raise InvalidParameterError(
422
+ "Bad parameter: destinations must be an list"
423
+ )
424
+ if "destination_replace_from" in params and not isinstance(
425
+ params["destination_replace_from"], str
426
+ ):
427
+ raise InvalidParameterError(
428
+ "Bad parameter: destination_replace_from must be an str"
429
+ )
430
+ if "destination_replace_to" in params and not isinstance(
431
+ params["destination_replace_to"], str
432
+ ):
433
+ raise InvalidParameterError(
434
+ "Bad parameter: destination_replace_to must be an str"
435
+ )
436
+ if "interval" in params and not isinstance(params["interval"], str):
437
+ raise InvalidParameterError("Bad parameter: interval must be an str")
438
+ if "path" in params and not isinstance(params["path"], str):
439
+ raise InvalidParameterError("Bad parameter: path must be an str")
440
+ if "legacy_sync_ids" in params and not isinstance(
441
+ params["legacy_sync_ids"], str
442
+ ):
443
+ raise InvalidParameterError(
444
+ "Bad parameter: legacy_sync_ids must be an str"
445
+ )
446
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
447
+ raise InvalidParameterError("Bad parameter: sync_ids must be an str")
448
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
449
+ raise InvalidParameterError("Bad parameter: user_ids must be an str")
450
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
451
+ raise InvalidParameterError("Bad parameter: group_ids must be an str")
452
+ if "schedule_days_of_week" in params and not isinstance(
453
+ params["schedule_days_of_week"], builtins.list
454
+ ):
455
+ raise InvalidParameterError(
456
+ "Bad parameter: schedule_days_of_week must be an list"
457
+ )
458
+ if "schedule_times_of_day" in params and not isinstance(
459
+ params["schedule_times_of_day"], builtins.list
460
+ ):
461
+ raise InvalidParameterError(
462
+ "Bad parameter: schedule_times_of_day must be an list"
463
+ )
464
+ if "schedule_time_zone" in params and not isinstance(
465
+ params["schedule_time_zone"], str
466
+ ):
467
+ raise InvalidParameterError(
468
+ "Bad parameter: schedule_time_zone must be an str"
469
+ )
470
+ if "holiday_region" in params and not isinstance(
471
+ params["holiday_region"], str
472
+ ):
473
+ raise InvalidParameterError(
474
+ "Bad parameter: holiday_region must be an str"
475
+ )
476
+ if "always_overwrite_size_matching_files" in params and not isinstance(
477
+ params["always_overwrite_size_matching_files"], bool
478
+ ):
479
+ raise InvalidParameterError(
480
+ "Bad parameter: always_overwrite_size_matching_files must be an bool"
481
+ )
482
+ if "always_serialize_jobs" in params and not isinstance(
483
+ params["always_serialize_jobs"], bool
484
+ ):
485
+ raise InvalidParameterError(
486
+ "Bad parameter: always_serialize_jobs must be an bool"
487
+ )
488
+ if "description" in params and not isinstance(params["description"], str):
489
+ raise InvalidParameterError(
490
+ "Bad parameter: description must be an str"
491
+ )
492
+ if "disabled" in params and not isinstance(params["disabled"], bool):
493
+ raise InvalidParameterError("Bad parameter: disabled must be an bool")
494
+ if "exclude_pattern" in params and not isinstance(
495
+ params["exclude_pattern"], str
496
+ ):
497
+ raise InvalidParameterError(
498
+ "Bad parameter: exclude_pattern must be an str"
499
+ )
500
+ if "import_urls" in params and not isinstance(
501
+ params["import_urls"], builtins.list
502
+ ):
503
+ raise InvalidParameterError(
504
+ "Bad parameter: import_urls must be an list"
505
+ )
506
+ if "flatten_destination_structure" in params and not isinstance(
507
+ params["flatten_destination_structure"], bool
508
+ ):
509
+ raise InvalidParameterError(
510
+ "Bad parameter: flatten_destination_structure must be an bool"
511
+ )
512
+ if "ignore_locked_folders" in params and not isinstance(
513
+ params["ignore_locked_folders"], bool
514
+ ):
515
+ raise InvalidParameterError(
516
+ "Bad parameter: ignore_locked_folders must be an bool"
517
+ )
518
+ if "legacy_folder_matching" in params and not isinstance(
519
+ params["legacy_folder_matching"], bool
520
+ ):
521
+ raise InvalidParameterError(
522
+ "Bad parameter: legacy_folder_matching must be an bool"
523
+ )
524
+ if "name" in params and not isinstance(params["name"], str):
525
+ raise InvalidParameterError("Bad parameter: name must be an str")
526
+ if "overwrite_files" in params and not isinstance(
527
+ params["overwrite_files"], bool
528
+ ):
529
+ raise InvalidParameterError(
530
+ "Bad parameter: overwrite_files must be an bool"
531
+ )
532
+ if "path_time_zone" in params and not isinstance(
533
+ params["path_time_zone"], str
534
+ ):
535
+ raise InvalidParameterError(
536
+ "Bad parameter: path_time_zone must be an str"
537
+ )
538
+ if "retry_on_failure_interval_in_minutes" in params and not isinstance(
539
+ params["retry_on_failure_interval_in_minutes"], int
540
+ ):
541
+ raise InvalidParameterError(
542
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
543
+ )
544
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
545
+ params["retry_on_failure_number_of_attempts"], int
546
+ ):
547
+ raise InvalidParameterError(
548
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
549
+ )
550
+ if "trigger" in params and not isinstance(params["trigger"], str):
551
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
552
+ if "trigger_actions" in params and not isinstance(
553
+ params["trigger_actions"], builtins.list
554
+ ):
555
+ raise InvalidParameterError(
556
+ "Bad parameter: trigger_actions must be an list"
557
+ )
558
+ if "value" in params and not isinstance(params["value"], dict):
559
+ raise InvalidParameterError("Bad parameter: value must be an dict")
560
+ if "recurring_day" in params and not isinstance(
561
+ params["recurring_day"], int
562
+ ):
563
+ raise InvalidParameterError(
564
+ "Bad parameter: recurring_day must be an int"
565
+ )
566
+ if "automation" in params and not isinstance(params["automation"], str):
567
+ raise InvalidParameterError("Bad parameter: automation must be an str")
568
+ if "workspace_id" in params and not isinstance(
569
+ params["workspace_id"], int
570
+ ):
571
+ raise InvalidParameterError(
572
+ "Bad parameter: workspace_id must be an int"
573
+ )
574
+ if "automation" not in params:
575
+ raise MissingParameterError("Parameter missing: automation")
576
+ response, options = Api.send_request(
577
+ "POST", "/automations", params, options
578
+ )
579
+ return Automation(response.data, options)
580
+
581
+
582
+ # Manually Run Automation
583
+ def manual_run(id, params=None, options=None):
584
+ if not isinstance(params, dict):
585
+ params = {}
586
+ if not isinstance(options, dict):
587
+ options = {}
588
+ params["id"] = id
589
+ if "id" in params and not isinstance(params["id"], int):
590
+ raise InvalidParameterError("Bad parameter: id must be an int")
591
+ if "id" not in params:
592
+ raise MissingParameterError("Parameter missing: id")
593
+ Api.send_request(
594
+ "POST",
595
+ "/automations/{id}/manual_run".format(id=params["id"]),
596
+ params,
597
+ options,
598
+ )
599
+
600
+
601
+ # Parameters:
602
+ # 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.
603
+ # destinations - array(string) - A list of String destination paths or Hash of folder_path and optional file_path.
604
+ # destination_replace_from - string - If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
605
+ # 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.
606
+ # interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
607
+ # path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
608
+ # legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
609
+ # sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
610
+ # user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
611
+ # group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
612
+ # 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.
613
+ # 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.
614
+ # schedule_time_zone - string - If trigger is `custom_schedule`. Time zone for the schedule.
615
+ # holiday_region - string - If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
616
+ # 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`.
617
+ # always_serialize_jobs - boolean - Ordinarily, we will allow automation runs to run in parallel for non-scheduled automations. If this flag is `true` we will force automation runs to be serialized (run one at a time, one after another). This can resolve some issues with race conditions on remote systems at the cost of some performance.
618
+ # description - string - Description for the this Automation.
619
+ # disabled - boolean - If true, this automation will not run.
620
+ # exclude_pattern - string - If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
621
+ # import_urls - array(object) - List of URLs to be imported and names to be used.
622
+ # 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.
623
+ # ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
624
+ # 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.
625
+ # name - string - Name for this automation.
626
+ # 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.
627
+ # path_time_zone - string - Timezone to use when rendering timestamps in paths.
628
+ # 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.
629
+ # 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.
630
+ # trigger - string - How this automation is triggered to run.
631
+ # 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, archived_delete, copy
632
+ # value - object - A Hash of attributes specific to the automation type.
633
+ # 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`.
634
+ # automation - string - Automation type
635
+ def update(id, params=None, options=None):
636
+ if not isinstance(params, dict):
637
+ params = {}
638
+ if not isinstance(options, dict):
639
+ options = {}
640
+ params["id"] = id
641
+ if "id" in params and not isinstance(params["id"], int):
642
+ raise InvalidParameterError("Bad parameter: id must be an int")
643
+ if "source" in params and not isinstance(params["source"], str):
644
+ raise InvalidParameterError("Bad parameter: source must be an str")
645
+ if "destinations" in params and not isinstance(
646
+ params["destinations"], builtins.list
647
+ ):
648
+ raise InvalidParameterError(
649
+ "Bad parameter: destinations must be an list"
650
+ )
651
+ if "destination_replace_from" in params and not isinstance(
652
+ params["destination_replace_from"], str
653
+ ):
654
+ raise InvalidParameterError(
655
+ "Bad parameter: destination_replace_from must be an str"
656
+ )
657
+ if "destination_replace_to" in params and not isinstance(
658
+ params["destination_replace_to"], str
659
+ ):
660
+ raise InvalidParameterError(
661
+ "Bad parameter: destination_replace_to must be an str"
662
+ )
663
+ if "interval" in params and not isinstance(params["interval"], str):
664
+ raise InvalidParameterError("Bad parameter: interval must be an str")
665
+ if "path" in params and not isinstance(params["path"], str):
666
+ raise InvalidParameterError("Bad parameter: path must be an str")
667
+ if "legacy_sync_ids" in params and not isinstance(
668
+ params["legacy_sync_ids"], str
669
+ ):
670
+ raise InvalidParameterError(
671
+ "Bad parameter: legacy_sync_ids must be an str"
672
+ )
673
+ if "sync_ids" in params and not isinstance(params["sync_ids"], str):
674
+ raise InvalidParameterError("Bad parameter: sync_ids must be an str")
675
+ if "user_ids" in params and not isinstance(params["user_ids"], str):
676
+ raise InvalidParameterError("Bad parameter: user_ids must be an str")
677
+ if "group_ids" in params and not isinstance(params["group_ids"], str):
678
+ raise InvalidParameterError("Bad parameter: group_ids must be an str")
679
+ if "schedule_days_of_week" in params and not isinstance(
680
+ params["schedule_days_of_week"], builtins.list
681
+ ):
682
+ raise InvalidParameterError(
683
+ "Bad parameter: schedule_days_of_week must be an list"
684
+ )
685
+ if "schedule_times_of_day" in params and not isinstance(
686
+ params["schedule_times_of_day"], builtins.list
687
+ ):
688
+ raise InvalidParameterError(
689
+ "Bad parameter: schedule_times_of_day must be an list"
690
+ )
691
+ if "schedule_time_zone" in params and not isinstance(
692
+ params["schedule_time_zone"], str
693
+ ):
694
+ raise InvalidParameterError(
695
+ "Bad parameter: schedule_time_zone must be an str"
696
+ )
697
+ if "holiday_region" in params and not isinstance(
698
+ params["holiday_region"], str
699
+ ):
700
+ raise InvalidParameterError(
701
+ "Bad parameter: holiday_region must be an str"
702
+ )
703
+ if "always_overwrite_size_matching_files" in params and not isinstance(
704
+ params["always_overwrite_size_matching_files"], bool
705
+ ):
706
+ raise InvalidParameterError(
707
+ "Bad parameter: always_overwrite_size_matching_files must be an bool"
708
+ )
709
+ if "always_serialize_jobs" in params and not isinstance(
710
+ params["always_serialize_jobs"], bool
711
+ ):
712
+ raise InvalidParameterError(
713
+ "Bad parameter: always_serialize_jobs must be an bool"
714
+ )
715
+ if "description" in params and not isinstance(params["description"], str):
716
+ raise InvalidParameterError(
717
+ "Bad parameter: description must be an str"
718
+ )
719
+ if "disabled" in params and not isinstance(params["disabled"], bool):
720
+ raise InvalidParameterError("Bad parameter: disabled must be an bool")
721
+ if "exclude_pattern" in params and not isinstance(
722
+ params["exclude_pattern"], str
723
+ ):
724
+ raise InvalidParameterError(
725
+ "Bad parameter: exclude_pattern must be an str"
726
+ )
727
+ if "import_urls" in params and not isinstance(
728
+ params["import_urls"], builtins.list
729
+ ):
730
+ raise InvalidParameterError(
731
+ "Bad parameter: import_urls must be an list"
732
+ )
733
+ if "flatten_destination_structure" in params and not isinstance(
734
+ params["flatten_destination_structure"], bool
735
+ ):
736
+ raise InvalidParameterError(
737
+ "Bad parameter: flatten_destination_structure must be an bool"
738
+ )
739
+ if "ignore_locked_folders" in params and not isinstance(
740
+ params["ignore_locked_folders"], bool
741
+ ):
742
+ raise InvalidParameterError(
743
+ "Bad parameter: ignore_locked_folders must be an bool"
744
+ )
745
+ if "legacy_folder_matching" in params and not isinstance(
746
+ params["legacy_folder_matching"], bool
747
+ ):
748
+ raise InvalidParameterError(
749
+ "Bad parameter: legacy_folder_matching must be an bool"
750
+ )
751
+ if "name" in params and not isinstance(params["name"], str):
752
+ raise InvalidParameterError("Bad parameter: name must be an str")
753
+ if "overwrite_files" in params and not isinstance(
754
+ params["overwrite_files"], bool
755
+ ):
756
+ raise InvalidParameterError(
757
+ "Bad parameter: overwrite_files must be an bool"
758
+ )
759
+ if "path_time_zone" in params and not isinstance(
760
+ params["path_time_zone"], str
761
+ ):
762
+ raise InvalidParameterError(
763
+ "Bad parameter: path_time_zone must be an str"
764
+ )
765
+ if "retry_on_failure_interval_in_minutes" in params and not isinstance(
766
+ params["retry_on_failure_interval_in_minutes"], int
767
+ ):
768
+ raise InvalidParameterError(
769
+ "Bad parameter: retry_on_failure_interval_in_minutes must be an int"
770
+ )
771
+ if "retry_on_failure_number_of_attempts" in params and not isinstance(
772
+ params["retry_on_failure_number_of_attempts"], int
773
+ ):
774
+ raise InvalidParameterError(
775
+ "Bad parameter: retry_on_failure_number_of_attempts must be an int"
776
+ )
777
+ if "trigger" in params and not isinstance(params["trigger"], str):
778
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
779
+ if "trigger_actions" in params and not isinstance(
780
+ params["trigger_actions"], builtins.list
781
+ ):
782
+ raise InvalidParameterError(
783
+ "Bad parameter: trigger_actions must be an list"
784
+ )
785
+ if "value" in params and not isinstance(params["value"], dict):
786
+ raise InvalidParameterError("Bad parameter: value must be an dict")
787
+ if "recurring_day" in params and not isinstance(
788
+ params["recurring_day"], int
789
+ ):
790
+ raise InvalidParameterError(
791
+ "Bad parameter: recurring_day must be an int"
792
+ )
793
+ if "automation" in params and not isinstance(params["automation"], str):
794
+ raise InvalidParameterError("Bad parameter: automation must be an str")
795
+ if "id" not in params:
796
+ raise MissingParameterError("Parameter missing: id")
797
+ response, options = Api.send_request(
798
+ "PATCH", "/automations/{id}".format(id=params["id"]), params, options
799
+ )
800
+ return Automation(response.data, options)
801
+
802
+
803
+ def delete(id, params=None, options=None):
804
+ if not isinstance(params, dict):
805
+ params = {}
806
+ if not isinstance(options, dict):
807
+ options = {}
808
+ params["id"] = id
809
+ if "id" in params and not isinstance(params["id"], int):
810
+ raise InvalidParameterError("Bad parameter: id must be an int")
811
+ if "id" not in params:
812
+ raise MissingParameterError("Parameter missing: id")
813
+ Api.send_request(
814
+ "DELETE", "/automations/{id}".format(id=params["id"]), params, options
815
+ )
816
+
817
+
818
+ def destroy(id, params=None, options=None):
819
+ delete(id, params, options)
820
+
821
+
822
+ def new(*args, **kwargs):
823
+ return Automation(*args, **kwargs)