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,588 @@
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 Sync:
12
+ default_attributes = {
13
+ "id": None, # int64 - Sync ID
14
+ "name": None, # string - Name for this sync job
15
+ "description": None, # string - Description for this sync job
16
+ "site_id": None, # int64 - Site ID this sync belongs to
17
+ "workspace_id": None, # int64 - Workspace ID this sync belongs to
18
+ "user_id": None, # int64 - User who created or owns this sync
19
+ "src_path": None, # string - Absolute source path for the sync
20
+ "dest_path": None, # string - Absolute destination path for the sync
21
+ "src_remote_server_id": None, # int64 - Remote server ID for the source (if remote)
22
+ "dest_remote_server_id": None, # int64 - Remote server ID for the destination (if remote)
23
+ "two_way": None, # boolean - Is this a two-way sync?
24
+ "keep_after_copy": None, # boolean - Keep files after copying?
25
+ "delete_empty_folders": None, # boolean - Delete empty folders after sync?
26
+ "disabled": None, # boolean - Is this sync disabled?
27
+ "trigger": None, # string - Trigger type: daily, custom_schedule, or manual
28
+ "trigger_file": None, # string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.
29
+ "include_patterns": None, # array(string) - Array of glob patterns to include
30
+ "exclude_patterns": None, # array(string) - Array of glob patterns to exclude
31
+ "created_at": None, # date-time - When this sync was created
32
+ "updated_at": None, # date-time - When this sync was last updated
33
+ "sync_interval_minutes": None, # int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
34
+ "interval": None, # string - If trigger is `daily`, this specifies how often to run this sync. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
35
+ "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`.
36
+ "schedule_days_of_week": None, # array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
37
+ "schedule_times_of_day": None, # array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
38
+ "schedule_time_zone": None, # string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
39
+ "holiday_region": None, # string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
40
+ "latest_sync_run": None, # SyncRun - The latest run of this sync
41
+ }
42
+
43
+ def __init__(self, attributes=None, options=None):
44
+ if not isinstance(attributes, dict):
45
+ attributes = {}
46
+ if not isinstance(options, dict):
47
+ options = {}
48
+ self.set_attributes(attributes)
49
+ self.options = options
50
+
51
+ def set_attributes(self, attributes):
52
+ for attribute, default_value in Sync.default_attributes.items():
53
+ setattr(self, attribute, attributes.get(attribute, default_value))
54
+
55
+ def get_attributes(self):
56
+ return {
57
+ k: getattr(self, k, None)
58
+ for k in Sync.default_attributes
59
+ if getattr(self, k, None) is not None
60
+ }
61
+
62
+ # Dry Run Sync
63
+ def dry_run(self, params=None):
64
+ if not isinstance(params, dict):
65
+ params = {}
66
+
67
+ if hasattr(self, "id") and self.id:
68
+ params["id"] = self.id
69
+ else:
70
+ raise MissingParameterError("Current object doesn't have a id")
71
+ if "id" not in params:
72
+ raise MissingParameterError("Parameter missing: id")
73
+ if "id" in params and not isinstance(params["id"], int):
74
+ raise InvalidParameterError("Bad parameter: id must be an int")
75
+ Api.send_request(
76
+ "POST",
77
+ "/syncs/{id}/dry_run".format(id=params["id"]),
78
+ params,
79
+ self.options,
80
+ )
81
+
82
+ # Manually Run Sync
83
+ def manual_run(self, params=None):
84
+ if not isinstance(params, dict):
85
+ params = {}
86
+
87
+ if hasattr(self, "id") and self.id:
88
+ params["id"] = self.id
89
+ else:
90
+ raise MissingParameterError("Current object doesn't have a id")
91
+ if "id" not in params:
92
+ raise MissingParameterError("Parameter missing: id")
93
+ if "id" in params and not isinstance(params["id"], int):
94
+ raise InvalidParameterError("Bad parameter: id must be an int")
95
+ Api.send_request(
96
+ "POST",
97
+ "/syncs/{id}/manual_run".format(id=params["id"]),
98
+ params,
99
+ self.options,
100
+ )
101
+
102
+ # Parameters:
103
+ # name - string - Name for this sync job
104
+ # description - string - Description for this sync job
105
+ # src_path - string - Absolute source path
106
+ # dest_path - string - Absolute destination path
107
+ # src_remote_server_id - int64 - Remote server ID for the source
108
+ # dest_remote_server_id - int64 - Remote server ID for the destination
109
+ # keep_after_copy - boolean - Keep files after copying?
110
+ # delete_empty_folders - boolean - Delete empty folders after sync?
111
+ # disabled - boolean - Is this sync disabled?
112
+ # interval - string - If trigger is `daily`, this specifies how often to run this sync. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
113
+ # trigger - string - Trigger type: daily, custom_schedule, or manual
114
+ # trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.
115
+ # holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
116
+ # sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
117
+ # 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`.
118
+ # schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
119
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
120
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
121
+ def update(self, params=None):
122
+ if not isinstance(params, dict):
123
+ params = {}
124
+
125
+ if hasattr(self, "id") and self.id:
126
+ params["id"] = self.id
127
+ else:
128
+ raise MissingParameterError("Current object doesn't have a id")
129
+ if "id" not in params:
130
+ raise MissingParameterError("Parameter missing: id")
131
+ if "id" in params and not isinstance(params["id"], int):
132
+ raise InvalidParameterError("Bad parameter: id must be an int")
133
+ if "name" in params and not isinstance(params["name"], str):
134
+ raise InvalidParameterError("Bad parameter: name must be an str")
135
+ if "description" in params and not isinstance(
136
+ params["description"], str
137
+ ):
138
+ raise InvalidParameterError(
139
+ "Bad parameter: description must be an str"
140
+ )
141
+ if "src_path" in params and not isinstance(params["src_path"], str):
142
+ raise InvalidParameterError(
143
+ "Bad parameter: src_path must be an str"
144
+ )
145
+ if "dest_path" in params and not isinstance(params["dest_path"], str):
146
+ raise InvalidParameterError(
147
+ "Bad parameter: dest_path must be an str"
148
+ )
149
+ if "src_remote_server_id" in params and not isinstance(
150
+ params["src_remote_server_id"], int
151
+ ):
152
+ raise InvalidParameterError(
153
+ "Bad parameter: src_remote_server_id must be an int"
154
+ )
155
+ if "dest_remote_server_id" in params and not isinstance(
156
+ params["dest_remote_server_id"], int
157
+ ):
158
+ raise InvalidParameterError(
159
+ "Bad parameter: dest_remote_server_id must be an int"
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 "trigger" in params and not isinstance(params["trigger"], str):
166
+ raise InvalidParameterError(
167
+ "Bad parameter: trigger must be an str"
168
+ )
169
+ if "trigger_file" in params and not isinstance(
170
+ params["trigger_file"], str
171
+ ):
172
+ raise InvalidParameterError(
173
+ "Bad parameter: trigger_file must be an str"
174
+ )
175
+ if "holiday_region" in params and not isinstance(
176
+ params["holiday_region"], str
177
+ ):
178
+ raise InvalidParameterError(
179
+ "Bad parameter: holiday_region must be an str"
180
+ )
181
+ if "sync_interval_minutes" in params and not isinstance(
182
+ params["sync_interval_minutes"], int
183
+ ):
184
+ raise InvalidParameterError(
185
+ "Bad parameter: sync_interval_minutes must be an int"
186
+ )
187
+ if "recurring_day" in params and not isinstance(
188
+ params["recurring_day"], int
189
+ ):
190
+ raise InvalidParameterError(
191
+ "Bad parameter: recurring_day must be an int"
192
+ )
193
+ if "schedule_time_zone" in params and not isinstance(
194
+ params["schedule_time_zone"], str
195
+ ):
196
+ raise InvalidParameterError(
197
+ "Bad parameter: schedule_time_zone must be an str"
198
+ )
199
+ if "schedule_days_of_week" in params and not isinstance(
200
+ params["schedule_days_of_week"], builtins.list
201
+ ):
202
+ raise InvalidParameterError(
203
+ "Bad parameter: schedule_days_of_week must be an list"
204
+ )
205
+ if "schedule_times_of_day" in params and not isinstance(
206
+ params["schedule_times_of_day"], builtins.list
207
+ ):
208
+ raise InvalidParameterError(
209
+ "Bad parameter: schedule_times_of_day must be an list"
210
+ )
211
+ response, _options = Api.send_request(
212
+ "PATCH",
213
+ "/syncs/{id}".format(id=params["id"]),
214
+ params,
215
+ self.options,
216
+ )
217
+ return response.data
218
+
219
+ def delete(self, params=None):
220
+ if not isinstance(params, dict):
221
+ params = {}
222
+
223
+ if hasattr(self, "id") and self.id:
224
+ params["id"] = self.id
225
+ else:
226
+ raise MissingParameterError("Current object doesn't have a id")
227
+ if "id" not in params:
228
+ raise MissingParameterError("Parameter missing: id")
229
+ if "id" in params and not isinstance(params["id"], int):
230
+ raise InvalidParameterError("Bad parameter: id must be an int")
231
+ Api.send_request(
232
+ "DELETE",
233
+ "/syncs/{id}".format(id=params["id"]),
234
+ params,
235
+ self.options,
236
+ )
237
+
238
+ def destroy(self, params=None):
239
+ self.delete(params)
240
+
241
+ def save(self):
242
+ if hasattr(self, "id") and self.id:
243
+ new_obj = self.update(self.get_attributes())
244
+ self.set_attributes(new_obj.get_attributes())
245
+ return True
246
+ else:
247
+ new_obj = create(self.get_attributes(), self.options)
248
+ self.set_attributes(new_obj.get_attributes())
249
+ return True
250
+
251
+
252
+ # Parameters:
253
+ # 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.
254
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
255
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id` or `name`.
256
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`, `disabled`, `src_remote_server_id` or `dest_remote_server_id`. Valid field combinations are `[ workspace_id, disabled ]`, `[ workspace_id, src_remote_server_id ]`, `[ workspace_id, dest_remote_server_id ]`, `[ disabled, src_remote_server_id ]`, `[ disabled, dest_remote_server_id ]`, `[ workspace_id, disabled, src_remote_server_id ]` or `[ workspace_id, disabled, dest_remote_server_id ]`.
257
+ def list(params=None, options=None):
258
+ if not isinstance(params, dict):
259
+ params = {}
260
+ if not isinstance(options, dict):
261
+ options = {}
262
+ if "cursor" in params and not isinstance(params["cursor"], str):
263
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
264
+ if "per_page" in params and not isinstance(params["per_page"], int):
265
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
266
+ if "sort_by" in params and not isinstance(params["sort_by"], dict):
267
+ raise InvalidParameterError("Bad parameter: sort_by must be an dict")
268
+ if "filter" in params and not isinstance(params["filter"], dict):
269
+ raise InvalidParameterError("Bad parameter: filter must be an dict")
270
+ return ListObj(Sync, "GET", "/syncs", params, options)
271
+
272
+
273
+ def all(params=None, options=None):
274
+ list(params, options)
275
+
276
+
277
+ # Parameters:
278
+ # id (required) - int64 - Sync ID.
279
+ def find(id, params=None, options=None):
280
+ if not isinstance(params, dict):
281
+ params = {}
282
+ if not isinstance(options, dict):
283
+ options = {}
284
+ params["id"] = id
285
+ if "id" in params and not isinstance(params["id"], int):
286
+ raise InvalidParameterError("Bad parameter: id must be an int")
287
+ if "id" not in params:
288
+ raise MissingParameterError("Parameter missing: id")
289
+ response, options = Api.send_request(
290
+ "GET", "/syncs/{id}".format(id=params["id"]), params, options
291
+ )
292
+ return Sync(response.data, options)
293
+
294
+
295
+ def get(id, params=None, options=None):
296
+ find(id, params, options)
297
+
298
+
299
+ # Parameters:
300
+ # name - string - Name for this sync job
301
+ # description - string - Description for this sync job
302
+ # src_path - string - Absolute source path
303
+ # dest_path - string - Absolute destination path
304
+ # src_remote_server_id - int64 - Remote server ID for the source
305
+ # dest_remote_server_id - int64 - Remote server ID for the destination
306
+ # keep_after_copy - boolean - Keep files after copying?
307
+ # delete_empty_folders - boolean - Delete empty folders after sync?
308
+ # disabled - boolean - Is this sync disabled?
309
+ # interval - string - If trigger is `daily`, this specifies how often to run this sync. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
310
+ # trigger - string - Trigger type: daily, custom_schedule, or manual
311
+ # trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.
312
+ # holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
313
+ # sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
314
+ # 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`.
315
+ # schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
316
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
317
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
318
+ # workspace_id - int64 - Workspace ID this sync belongs to
319
+ def create(params=None, options=None):
320
+ if not isinstance(params, dict):
321
+ params = {}
322
+ if not isinstance(options, dict):
323
+ options = {}
324
+ if "name" in params and not isinstance(params["name"], str):
325
+ raise InvalidParameterError("Bad parameter: name must be an str")
326
+ if "description" in params and not isinstance(params["description"], str):
327
+ raise InvalidParameterError(
328
+ "Bad parameter: description must be an str"
329
+ )
330
+ if "src_path" in params and not isinstance(params["src_path"], str):
331
+ raise InvalidParameterError("Bad parameter: src_path must be an str")
332
+ if "dest_path" in params and not isinstance(params["dest_path"], str):
333
+ raise InvalidParameterError("Bad parameter: dest_path must be an str")
334
+ if "src_remote_server_id" in params and not isinstance(
335
+ params["src_remote_server_id"], int
336
+ ):
337
+ raise InvalidParameterError(
338
+ "Bad parameter: src_remote_server_id must be an int"
339
+ )
340
+ if "dest_remote_server_id" in params and not isinstance(
341
+ params["dest_remote_server_id"], int
342
+ ):
343
+ raise InvalidParameterError(
344
+ "Bad parameter: dest_remote_server_id must be an int"
345
+ )
346
+ if "keep_after_copy" in params and not isinstance(
347
+ params["keep_after_copy"], bool
348
+ ):
349
+ raise InvalidParameterError(
350
+ "Bad parameter: keep_after_copy must be an bool"
351
+ )
352
+ if "delete_empty_folders" in params and not isinstance(
353
+ params["delete_empty_folders"], bool
354
+ ):
355
+ raise InvalidParameterError(
356
+ "Bad parameter: delete_empty_folders must be an bool"
357
+ )
358
+ if "disabled" in params and not isinstance(params["disabled"], bool):
359
+ raise InvalidParameterError("Bad parameter: disabled must be an bool")
360
+ if "interval" in params and not isinstance(params["interval"], str):
361
+ raise InvalidParameterError("Bad parameter: interval must be an str")
362
+ if "trigger" in params and not isinstance(params["trigger"], str):
363
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
364
+ if "trigger_file" in params and not isinstance(
365
+ params["trigger_file"], str
366
+ ):
367
+ raise InvalidParameterError(
368
+ "Bad parameter: trigger_file must be an str"
369
+ )
370
+ if "holiday_region" in params and not isinstance(
371
+ params["holiday_region"], str
372
+ ):
373
+ raise InvalidParameterError(
374
+ "Bad parameter: holiday_region must be an str"
375
+ )
376
+ if "sync_interval_minutes" in params and not isinstance(
377
+ params["sync_interval_minutes"], int
378
+ ):
379
+ raise InvalidParameterError(
380
+ "Bad parameter: sync_interval_minutes must be an int"
381
+ )
382
+ if "recurring_day" in params and not isinstance(
383
+ params["recurring_day"], int
384
+ ):
385
+ raise InvalidParameterError(
386
+ "Bad parameter: recurring_day must be an int"
387
+ )
388
+ if "schedule_time_zone" in params and not isinstance(
389
+ params["schedule_time_zone"], str
390
+ ):
391
+ raise InvalidParameterError(
392
+ "Bad parameter: schedule_time_zone must be an str"
393
+ )
394
+ if "schedule_days_of_week" in params and not isinstance(
395
+ params["schedule_days_of_week"], builtins.list
396
+ ):
397
+ raise InvalidParameterError(
398
+ "Bad parameter: schedule_days_of_week must be an list"
399
+ )
400
+ if "schedule_times_of_day" in params and not isinstance(
401
+ params["schedule_times_of_day"], builtins.list
402
+ ):
403
+ raise InvalidParameterError(
404
+ "Bad parameter: schedule_times_of_day must be an list"
405
+ )
406
+ if "workspace_id" in params and not isinstance(
407
+ params["workspace_id"], int
408
+ ):
409
+ raise InvalidParameterError(
410
+ "Bad parameter: workspace_id must be an int"
411
+ )
412
+ response, options = Api.send_request("POST", "/syncs", params, options)
413
+ return Sync(response.data, options)
414
+
415
+
416
+ # Dry Run Sync
417
+ def dry_run(id, params=None, options=None):
418
+ if not isinstance(params, dict):
419
+ params = {}
420
+ if not isinstance(options, dict):
421
+ options = {}
422
+ params["id"] = id
423
+ if "id" in params and not isinstance(params["id"], int):
424
+ raise InvalidParameterError("Bad parameter: id must be an int")
425
+ if "id" not in params:
426
+ raise MissingParameterError("Parameter missing: id")
427
+ Api.send_request(
428
+ "POST", "/syncs/{id}/dry_run".format(id=params["id"]), params, options
429
+ )
430
+
431
+
432
+ # Manually Run Sync
433
+ def manual_run(id, params=None, options=None):
434
+ if not isinstance(params, dict):
435
+ params = {}
436
+ if not isinstance(options, dict):
437
+ options = {}
438
+ params["id"] = id
439
+ if "id" in params and not isinstance(params["id"], int):
440
+ raise InvalidParameterError("Bad parameter: id must be an int")
441
+ if "id" not in params:
442
+ raise MissingParameterError("Parameter missing: id")
443
+ Api.send_request(
444
+ "POST",
445
+ "/syncs/{id}/manual_run".format(id=params["id"]),
446
+ params,
447
+ options,
448
+ )
449
+
450
+
451
+ # Parameters:
452
+ # name - string - Name for this sync job
453
+ # description - string - Description for this sync job
454
+ # src_path - string - Absolute source path
455
+ # dest_path - string - Absolute destination path
456
+ # src_remote_server_id - int64 - Remote server ID for the source
457
+ # dest_remote_server_id - int64 - Remote server ID for the destination
458
+ # keep_after_copy - boolean - Keep files after copying?
459
+ # delete_empty_folders - boolean - Delete empty folders after sync?
460
+ # disabled - boolean - Is this sync disabled?
461
+ # interval - string - If trigger is `daily`, this specifies how often to run this sync. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
462
+ # trigger - string - Trigger type: daily, custom_schedule, or manual
463
+ # trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.
464
+ # holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
465
+ # sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
466
+ # 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`.
467
+ # schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
468
+ # schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
469
+ # schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
470
+ def update(id, params=None, options=None):
471
+ if not isinstance(params, dict):
472
+ params = {}
473
+ if not isinstance(options, dict):
474
+ options = {}
475
+ params["id"] = id
476
+ if "id" in params and not isinstance(params["id"], int):
477
+ raise InvalidParameterError("Bad parameter: id must be an int")
478
+ if "name" in params and not isinstance(params["name"], str):
479
+ raise InvalidParameterError("Bad parameter: name must be an str")
480
+ if "description" in params and not isinstance(params["description"], str):
481
+ raise InvalidParameterError(
482
+ "Bad parameter: description must be an str"
483
+ )
484
+ if "src_path" in params and not isinstance(params["src_path"], str):
485
+ raise InvalidParameterError("Bad parameter: src_path must be an str")
486
+ if "dest_path" in params and not isinstance(params["dest_path"], str):
487
+ raise InvalidParameterError("Bad parameter: dest_path must be an str")
488
+ if "src_remote_server_id" in params and not isinstance(
489
+ params["src_remote_server_id"], int
490
+ ):
491
+ raise InvalidParameterError(
492
+ "Bad parameter: src_remote_server_id must be an int"
493
+ )
494
+ if "dest_remote_server_id" in params and not isinstance(
495
+ params["dest_remote_server_id"], int
496
+ ):
497
+ raise InvalidParameterError(
498
+ "Bad parameter: dest_remote_server_id must be an int"
499
+ )
500
+ if "keep_after_copy" in params and not isinstance(
501
+ params["keep_after_copy"], bool
502
+ ):
503
+ raise InvalidParameterError(
504
+ "Bad parameter: keep_after_copy must be an bool"
505
+ )
506
+ if "delete_empty_folders" in params and not isinstance(
507
+ params["delete_empty_folders"], bool
508
+ ):
509
+ raise InvalidParameterError(
510
+ "Bad parameter: delete_empty_folders must be an bool"
511
+ )
512
+ if "disabled" in params and not isinstance(params["disabled"], bool):
513
+ raise InvalidParameterError("Bad parameter: disabled must be an bool")
514
+ if "interval" in params and not isinstance(params["interval"], str):
515
+ raise InvalidParameterError("Bad parameter: interval must be an str")
516
+ if "trigger" in params and not isinstance(params["trigger"], str):
517
+ raise InvalidParameterError("Bad parameter: trigger must be an str")
518
+ if "trigger_file" in params and not isinstance(
519
+ params["trigger_file"], str
520
+ ):
521
+ raise InvalidParameterError(
522
+ "Bad parameter: trigger_file must be an str"
523
+ )
524
+ if "holiday_region" in params and not isinstance(
525
+ params["holiday_region"], str
526
+ ):
527
+ raise InvalidParameterError(
528
+ "Bad parameter: holiday_region must be an str"
529
+ )
530
+ if "sync_interval_minutes" in params and not isinstance(
531
+ params["sync_interval_minutes"], int
532
+ ):
533
+ raise InvalidParameterError(
534
+ "Bad parameter: sync_interval_minutes must be an int"
535
+ )
536
+ if "recurring_day" in params and not isinstance(
537
+ params["recurring_day"], int
538
+ ):
539
+ raise InvalidParameterError(
540
+ "Bad parameter: recurring_day must be an int"
541
+ )
542
+ if "schedule_time_zone" in params and not isinstance(
543
+ params["schedule_time_zone"], str
544
+ ):
545
+ raise InvalidParameterError(
546
+ "Bad parameter: schedule_time_zone must be an str"
547
+ )
548
+ if "schedule_days_of_week" in params and not isinstance(
549
+ params["schedule_days_of_week"], builtins.list
550
+ ):
551
+ raise InvalidParameterError(
552
+ "Bad parameter: schedule_days_of_week must be an list"
553
+ )
554
+ if "schedule_times_of_day" in params and not isinstance(
555
+ params["schedule_times_of_day"], builtins.list
556
+ ):
557
+ raise InvalidParameterError(
558
+ "Bad parameter: schedule_times_of_day must be an list"
559
+ )
560
+ if "id" not in params:
561
+ raise MissingParameterError("Parameter missing: id")
562
+ response, options = Api.send_request(
563
+ "PATCH", "/syncs/{id}".format(id=params["id"]), params, options
564
+ )
565
+ return Sync(response.data, options)
566
+
567
+
568
+ def delete(id, params=None, options=None):
569
+ if not isinstance(params, dict):
570
+ params = {}
571
+ if not isinstance(options, dict):
572
+ options = {}
573
+ params["id"] = id
574
+ if "id" in params and not isinstance(params["id"], int):
575
+ raise InvalidParameterError("Bad parameter: id must be an int")
576
+ if "id" not in params:
577
+ raise MissingParameterError("Parameter missing: id")
578
+ Api.send_request(
579
+ "DELETE", "/syncs/{id}".format(id=params["id"]), params, options
580
+ )
581
+
582
+
583
+ def destroy(id, params=None, options=None):
584
+ delete(id, params, options)
585
+
586
+
587
+ def new(*args, **kwargs):
588
+ return Sync(*args, **kwargs)