files.com 1.1.267 → 1.1.268
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.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/site.md +4 -0
- data/docs/sync.md +275 -0
- data/docs/sync_run.md +81 -0
- data/lib/files.com/models/site.rb +6 -0
- data/lib/files.com/models/sync.rb +426 -0
- data/lib/files.com/models/sync_run.rb +148 -0
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b433bf1d351c20cd04af853b765bee5b088ac190875f37586400b94ac0d95b6b
|
4
|
+
data.tar.gz: 1fd1bf08d017b6ca0c72e8c17cd33079cacb4fd4bce033dc2e56f9f8681e38ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad2b7052c2eda5e359a055e81008090fa7ca51c1384e910f66150f1b9c3f16d9b22023b40e1632c08730c7526a91ae093393e36608c9548d9f30c73ad39ca2ca
|
7
|
+
data.tar.gz: 968b71fa49008619d34f22f3db9b30ff020606fe7a0d8fde9db2200c7138645a8fd64e8435a2c4ee49e3272ee3aa34b37a084d436e004e2b12b45e9118c3d091
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.268
|
data/docs/site.md
CHANGED
@@ -68,6 +68,7 @@
|
|
68
68
|
"desktop_app_session_ip_pinning": true,
|
69
69
|
"desktop_app_session_lifetime": 1,
|
70
70
|
"legacy_checksums_mode": true,
|
71
|
+
"migrate_remote_server_sync_to_sync": true,
|
71
72
|
"mobile_app": true,
|
72
73
|
"mobile_app_session_ip_pinning": true,
|
73
74
|
"mobile_app_session_lifetime": 1,
|
@@ -358,6 +359,7 @@
|
|
358
359
|
* `desktop_app_session_ip_pinning` (boolean): Is desktop app session IP pinning enabled?
|
359
360
|
* `desktop_app_session_lifetime` (int64): Desktop app session lifetime (in hours)
|
360
361
|
* `legacy_checksums_mode` (boolean): Use legacy checksums mode?
|
362
|
+
* `migrate_remote_server_sync_to_sync` (boolean): If true, we will migrate all remote server syncs to the new Sync model.
|
361
363
|
* `mobile_app` (boolean): Is the mobile app enabled?
|
362
364
|
* `mobile_app_session_ip_pinning` (boolean): Is mobile app session IP pinning enabled?
|
363
365
|
* `mobile_app_session_lifetime` (int64): Mobile app session lifetime (in hours)
|
@@ -540,6 +542,7 @@ Files::Site.update(
|
|
540
542
|
calculate_file_checksums_sha1: false,
|
541
543
|
calculate_file_checksums_sha256: false,
|
542
544
|
legacy_checksums_mode: false,
|
545
|
+
migrate_remote_server_sync_to_sync: false,
|
543
546
|
session_expiry: 1.0,
|
544
547
|
ssl_required: false,
|
545
548
|
tls_disabled: false,
|
@@ -699,6 +702,7 @@ Files::Site.update(
|
|
699
702
|
* `calculate_file_checksums_sha1` (boolean): Calculate SHA1 checksums for files?
|
700
703
|
* `calculate_file_checksums_sha256` (boolean): Calculate SHA256 checksums for files?
|
701
704
|
* `legacy_checksums_mode` (boolean): Use legacy checksums mode?
|
705
|
+
* `migrate_remote_server_sync_to_sync` (boolean): If true, we will migrate all remote server syncs to the new Sync model.
|
702
706
|
* `session_expiry` (double): Session expiry in hours
|
703
707
|
* `ssl_required` (boolean): Is SSL required? Disabling this is insecure.
|
704
708
|
* `tls_disabled` (boolean): DO NOT ENABLE. This setting allows TLSv1.0 and TLSv1.1 to be used on your site. We intend to remove this capability entirely in early 2024. If set, the `sftp_insecure_ciphers` flag will be automatically set to true.
|
data/docs/sync.md
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
# Sync
|
2
|
+
|
3
|
+
## Example Sync Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"id": 1,
|
8
|
+
"name": "example",
|
9
|
+
"description": "example",
|
10
|
+
"site_id": 1,
|
11
|
+
"user_id": 1,
|
12
|
+
"src_path": "example",
|
13
|
+
"dest_path": "example",
|
14
|
+
"src_remote_server_id": 1,
|
15
|
+
"dest_remote_server_id": 1,
|
16
|
+
"two_way": true,
|
17
|
+
"keep_after_copy": true,
|
18
|
+
"delete_empty_folders": true,
|
19
|
+
"disabled": true,
|
20
|
+
"interval": "week",
|
21
|
+
"trigger": "example",
|
22
|
+
"trigger_file": "example",
|
23
|
+
"include_patterns": "example",
|
24
|
+
"exclude_patterns": "example",
|
25
|
+
"created_at": "2000-01-01T01:00:00Z",
|
26
|
+
"updated_at": "2000-01-01T01:00:00Z",
|
27
|
+
"sync_interval_minutes": 1,
|
28
|
+
"recurring_day": 25,
|
29
|
+
"schedule_days_of_week": [
|
30
|
+
0,
|
31
|
+
2,
|
32
|
+
4
|
33
|
+
],
|
34
|
+
"schedule_times_of_day": [
|
35
|
+
"06:30",
|
36
|
+
"14:30"
|
37
|
+
],
|
38
|
+
"schedule_time_zone": "Eastern Time (US & Canada)"
|
39
|
+
}
|
40
|
+
```
|
41
|
+
|
42
|
+
* `id` (int64): Sync ID
|
43
|
+
* `name` (string): Name for this sync job
|
44
|
+
* `description` (string): Description for this sync job
|
45
|
+
* `site_id` (int64): Site ID this sync belongs to
|
46
|
+
* `user_id` (int64): User who created or owns this sync
|
47
|
+
* `src_path` (string): Absolute source path for the sync
|
48
|
+
* `dest_path` (string): Absolute destination path for the sync
|
49
|
+
* `src_remote_server_id` (int64): Remote server ID for the source (if remote)
|
50
|
+
* `dest_remote_server_id` (int64): Remote server ID for the destination (if remote)
|
51
|
+
* `two_way` (boolean): Is this a two-way sync?
|
52
|
+
* `keep_after_copy` (boolean): Keep files after copying?
|
53
|
+
* `delete_empty_folders` (boolean): Delete empty folders after sync?
|
54
|
+
* `disabled` (boolean): Is this sync disabled?
|
55
|
+
* `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`
|
56
|
+
* `trigger` (string): Trigger type: daily, custom_schedule, or manual
|
57
|
+
* `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.
|
58
|
+
* `include_patterns` (array(array)): Array of glob patterns to include
|
59
|
+
* `exclude_patterns` (array(array)): Array of glob patterns to exclude
|
60
|
+
* `created_at` (date-time): When this sync was created
|
61
|
+
* `updated_at` (date-time): When this sync was last updated
|
62
|
+
* `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.
|
63
|
+
* `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`.
|
64
|
+
* `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.
|
65
|
+
* `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.
|
66
|
+
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
67
|
+
|
68
|
+
|
69
|
+
---
|
70
|
+
|
71
|
+
## List Syncs
|
72
|
+
|
73
|
+
```
|
74
|
+
Files::Sync.list
|
75
|
+
```
|
76
|
+
|
77
|
+
### Parameters
|
78
|
+
|
79
|
+
* `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.
|
80
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
81
|
+
|
82
|
+
|
83
|
+
---
|
84
|
+
|
85
|
+
## Show Sync
|
86
|
+
|
87
|
+
```
|
88
|
+
Files::Sync.find(id)
|
89
|
+
```
|
90
|
+
|
91
|
+
### Parameters
|
92
|
+
|
93
|
+
* `id` (int64): Required - Sync ID.
|
94
|
+
|
95
|
+
|
96
|
+
---
|
97
|
+
|
98
|
+
## Create Sync
|
99
|
+
|
100
|
+
```
|
101
|
+
Files::Sync.create(
|
102
|
+
name: "example",
|
103
|
+
description: "example",
|
104
|
+
src_path: "example",
|
105
|
+
dest_path: "example",
|
106
|
+
src_remote_server_id: 1,
|
107
|
+
dest_remote_server_id: 1,
|
108
|
+
two_way: false,
|
109
|
+
keep_after_copy: false,
|
110
|
+
delete_empty_folders: false,
|
111
|
+
disabled: false,
|
112
|
+
interval: 1,
|
113
|
+
trigger: "example",
|
114
|
+
trigger_file: "example",
|
115
|
+
recurring_day: 25,
|
116
|
+
schedule_time_zone: "Eastern Time (US & Canada)",
|
117
|
+
schedule_days_of_week: [0,2,4],
|
118
|
+
schedule_times_of_day: ["06:30","14:30"]
|
119
|
+
)
|
120
|
+
```
|
121
|
+
|
122
|
+
### Parameters
|
123
|
+
|
124
|
+
* `name` (string): Name for this sync job
|
125
|
+
* `description` (string): Description for this sync job
|
126
|
+
* `src_path` (string): Absolute source path
|
127
|
+
* `dest_path` (string): Absolute destination path
|
128
|
+
* `src_remote_server_id` (int64): Remote server ID for the source
|
129
|
+
* `dest_remote_server_id` (int64): Remote server ID for the destination
|
130
|
+
* `two_way` (boolean): Is this a two-way sync?
|
131
|
+
* `keep_after_copy` (boolean): Keep files after copying?
|
132
|
+
* `delete_empty_folders` (boolean): Delete empty folders after sync?
|
133
|
+
* `disabled` (boolean): Is this sync disabled?
|
134
|
+
* `interval` (int64): Interval in minutes for sync (if scheduled)
|
135
|
+
* `trigger` (string): Trigger type: daily, custom_schedule, or manual
|
136
|
+
* `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.
|
137
|
+
* `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`.
|
138
|
+
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
139
|
+
* `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.
|
140
|
+
* `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.
|
141
|
+
|
142
|
+
|
143
|
+
---
|
144
|
+
|
145
|
+
## Migrate Legacy Syncs to Syncs
|
146
|
+
|
147
|
+
```
|
148
|
+
Files::Sync.create_migrate_to
|
149
|
+
```
|
150
|
+
|
151
|
+
|
152
|
+
---
|
153
|
+
|
154
|
+
## Update Sync
|
155
|
+
|
156
|
+
```
|
157
|
+
Files::Sync.update(id,
|
158
|
+
name: "example",
|
159
|
+
description: "example",
|
160
|
+
src_path: "example",
|
161
|
+
dest_path: "example",
|
162
|
+
src_remote_server_id: 1,
|
163
|
+
dest_remote_server_id: 1,
|
164
|
+
two_way: false,
|
165
|
+
keep_after_copy: false,
|
166
|
+
delete_empty_folders: false,
|
167
|
+
disabled: false,
|
168
|
+
interval: 1,
|
169
|
+
trigger: "example",
|
170
|
+
trigger_file: "example",
|
171
|
+
recurring_day: 25,
|
172
|
+
schedule_time_zone: "Eastern Time (US & Canada)",
|
173
|
+
schedule_days_of_week: [0,2,4],
|
174
|
+
schedule_times_of_day: ["06:30","14:30"]
|
175
|
+
)
|
176
|
+
```
|
177
|
+
|
178
|
+
### Parameters
|
179
|
+
|
180
|
+
* `id` (int64): Required - Sync ID.
|
181
|
+
* `name` (string): Name for this sync job
|
182
|
+
* `description` (string): Description for this sync job
|
183
|
+
* `src_path` (string): Absolute source path
|
184
|
+
* `dest_path` (string): Absolute destination path
|
185
|
+
* `src_remote_server_id` (int64): Remote server ID for the source
|
186
|
+
* `dest_remote_server_id` (int64): Remote server ID for the destination
|
187
|
+
* `two_way` (boolean): Is this a two-way sync?
|
188
|
+
* `keep_after_copy` (boolean): Keep files after copying?
|
189
|
+
* `delete_empty_folders` (boolean): Delete empty folders after sync?
|
190
|
+
* `disabled` (boolean): Is this sync disabled?
|
191
|
+
* `interval` (int64): Interval in minutes for sync (if scheduled)
|
192
|
+
* `trigger` (string): Trigger type: daily, custom_schedule, or manual
|
193
|
+
* `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.
|
194
|
+
* `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`.
|
195
|
+
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
196
|
+
* `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.
|
197
|
+
* `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.
|
198
|
+
|
199
|
+
|
200
|
+
---
|
201
|
+
|
202
|
+
## Delete Sync
|
203
|
+
|
204
|
+
```
|
205
|
+
Files::Sync.delete(id)
|
206
|
+
```
|
207
|
+
|
208
|
+
### Parameters
|
209
|
+
|
210
|
+
* `id` (int64): Required - Sync ID.
|
211
|
+
|
212
|
+
|
213
|
+
---
|
214
|
+
|
215
|
+
## Update Sync
|
216
|
+
|
217
|
+
```
|
218
|
+
sync = Files::Sync.find(id)
|
219
|
+
|
220
|
+
sync.update(
|
221
|
+
name: "example",
|
222
|
+
description: "example",
|
223
|
+
src_path: "example",
|
224
|
+
dest_path: "example",
|
225
|
+
src_remote_server_id: 1,
|
226
|
+
dest_remote_server_id: 1,
|
227
|
+
two_way: false,
|
228
|
+
keep_after_copy: false,
|
229
|
+
delete_empty_folders: false,
|
230
|
+
disabled: false,
|
231
|
+
interval: 1,
|
232
|
+
trigger: "example",
|
233
|
+
trigger_file: "example",
|
234
|
+
recurring_day: 25,
|
235
|
+
schedule_time_zone: "Eastern Time (US & Canada)",
|
236
|
+
schedule_days_of_week: [0,2,4],
|
237
|
+
schedule_times_of_day: ["06:30","14:30"]
|
238
|
+
)
|
239
|
+
```
|
240
|
+
|
241
|
+
### Parameters
|
242
|
+
|
243
|
+
* `id` (int64): Required - Sync ID.
|
244
|
+
* `name` (string): Name for this sync job
|
245
|
+
* `description` (string): Description for this sync job
|
246
|
+
* `src_path` (string): Absolute source path
|
247
|
+
* `dest_path` (string): Absolute destination path
|
248
|
+
* `src_remote_server_id` (int64): Remote server ID for the source
|
249
|
+
* `dest_remote_server_id` (int64): Remote server ID for the destination
|
250
|
+
* `two_way` (boolean): Is this a two-way sync?
|
251
|
+
* `keep_after_copy` (boolean): Keep files after copying?
|
252
|
+
* `delete_empty_folders` (boolean): Delete empty folders after sync?
|
253
|
+
* `disabled` (boolean): Is this sync disabled?
|
254
|
+
* `interval` (int64): Interval in minutes for sync (if scheduled)
|
255
|
+
* `trigger` (string): Trigger type: daily, custom_schedule, or manual
|
256
|
+
* `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.
|
257
|
+
* `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`.
|
258
|
+
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
259
|
+
* `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.
|
260
|
+
* `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.
|
261
|
+
|
262
|
+
|
263
|
+
---
|
264
|
+
|
265
|
+
## Delete Sync
|
266
|
+
|
267
|
+
```
|
268
|
+
sync = Files::Sync.find(id)
|
269
|
+
|
270
|
+
sync.delete
|
271
|
+
```
|
272
|
+
|
273
|
+
### Parameters
|
274
|
+
|
275
|
+
* `id` (int64): Required - Sync ID.
|
data/docs/sync_run.md
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# SyncRun
|
2
|
+
|
3
|
+
## Example SyncRun Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"id": 1,
|
8
|
+
"sync_id": 1,
|
9
|
+
"site_id": 1,
|
10
|
+
"status": "example",
|
11
|
+
"remote_server_type": "example",
|
12
|
+
"body": "example",
|
13
|
+
"event_errors": "example",
|
14
|
+
"bytes_synced": 1,
|
15
|
+
"compared_files": 1,
|
16
|
+
"compared_folders": 1,
|
17
|
+
"errored_files": 1,
|
18
|
+
"successful_files": 1,
|
19
|
+
"runtime": "example",
|
20
|
+
"s3_body_path": "example",
|
21
|
+
"s3_internal_body_path": "example",
|
22
|
+
"completed_at": "2000-01-01T01:00:00Z",
|
23
|
+
"notified": true,
|
24
|
+
"created_at": "2000-01-01T01:00:00Z",
|
25
|
+
"updated_at": "2000-01-01T01:00:00Z"
|
26
|
+
}
|
27
|
+
```
|
28
|
+
|
29
|
+
* `id` (int64): SyncRun ID
|
30
|
+
* `sync_id` (int64): ID of the Sync this run belongs to
|
31
|
+
* `site_id` (int64): Site ID
|
32
|
+
* `status` (string): Status of the sync run (success, failure, partial_failure, in_progress, skipped)
|
33
|
+
* `remote_server_type` (string): Type of remote server used, if any
|
34
|
+
* `body` (string): Log or summary body for this run
|
35
|
+
* `event_errors` (array(array)): Array of errors encountered during the run
|
36
|
+
* `bytes_synced` (int64): Total bytes synced in this run
|
37
|
+
* `compared_files` (int64): Number of files compared
|
38
|
+
* `compared_folders` (int64): Number of folders compared
|
39
|
+
* `errored_files` (int64): Number of files that errored
|
40
|
+
* `successful_files` (int64): Number of files successfully synced
|
41
|
+
* `runtime` (float): Total runtime in seconds
|
42
|
+
* `s3_body_path` (string): S3 path to the main log file
|
43
|
+
* `s3_internal_body_path` (string): S3 path to the internal log file
|
44
|
+
* `completed_at` (date-time): When this run was completed
|
45
|
+
* `notified` (boolean): Whether notifications were sent for this run
|
46
|
+
* `created_at` (date-time): When this run was created
|
47
|
+
* `updated_at` (date-time): When this run was last updated
|
48
|
+
|
49
|
+
|
50
|
+
---
|
51
|
+
|
52
|
+
## List Sync Runs
|
53
|
+
|
54
|
+
```
|
55
|
+
Files::SyncRun.list(
|
56
|
+
user_id: 1,
|
57
|
+
sync_id: 1
|
58
|
+
)
|
59
|
+
```
|
60
|
+
|
61
|
+
### Parameters
|
62
|
+
|
63
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
64
|
+
* `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.
|
65
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
66
|
+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `sync_id`, `created_at` or `status`.
|
67
|
+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `sync_id`. Valid field combinations are `[ sync_id, status ]`.
|
68
|
+
* `sync_id` (int64): Required - ID of the Sync this run belongs to
|
69
|
+
|
70
|
+
|
71
|
+
---
|
72
|
+
|
73
|
+
## Show Sync Run
|
74
|
+
|
75
|
+
```
|
76
|
+
Files::SyncRun.find(id)
|
77
|
+
```
|
78
|
+
|
79
|
+
### Parameters
|
80
|
+
|
81
|
+
* `id` (int64): Required - Sync Run ID.
|
@@ -284,6 +284,11 @@ module Files
|
|
284
284
|
@attributes[:legacy_checksums_mode]
|
285
285
|
end
|
286
286
|
|
287
|
+
# boolean - If true, we will migrate all remote server syncs to the new Sync model.
|
288
|
+
def migrate_remote_server_sync_to_sync
|
289
|
+
@attributes[:migrate_remote_server_sync_to_sync]
|
290
|
+
end
|
291
|
+
|
287
292
|
# boolean - Is the mobile app enabled?
|
288
293
|
def mobile_app
|
289
294
|
@attributes[:mobile_app]
|
@@ -912,6 +917,7 @@ module Files
|
|
912
917
|
# calculate_file_checksums_sha1 - boolean - Calculate SHA1 checksums for files?
|
913
918
|
# calculate_file_checksums_sha256 - boolean - Calculate SHA256 checksums for files?
|
914
919
|
# legacy_checksums_mode - boolean - Use legacy checksums mode?
|
920
|
+
# migrate_remote_server_sync_to_sync - boolean - If true, we will migrate all remote server syncs to the new Sync model.
|
915
921
|
# session_expiry - double - Session expiry in hours
|
916
922
|
# ssl_required - boolean - Is SSL required? Disabling this is insecure.
|
917
923
|
# tls_disabled - boolean - DO NOT ENABLE. This setting allows TLSv1.0 and TLSv1.1 to be used on your site. We intend to remove this capability entirely in early 2024. If set, the `sftp_insecure_ciphers` flag will be automatically set to true.
|
@@ -0,0 +1,426 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class Sync
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - Sync ID
|
13
|
+
def id
|
14
|
+
@attributes[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def id=(value)
|
18
|
+
@attributes[:id] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# string - Name for this sync job
|
22
|
+
def name
|
23
|
+
@attributes[:name]
|
24
|
+
end
|
25
|
+
|
26
|
+
def name=(value)
|
27
|
+
@attributes[:name] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - Description for this sync job
|
31
|
+
def description
|
32
|
+
@attributes[:description]
|
33
|
+
end
|
34
|
+
|
35
|
+
def description=(value)
|
36
|
+
@attributes[:description] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# int64 - Site ID this sync belongs to
|
40
|
+
def site_id
|
41
|
+
@attributes[:site_id]
|
42
|
+
end
|
43
|
+
|
44
|
+
def site_id=(value)
|
45
|
+
@attributes[:site_id] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# int64 - User who created or owns this sync
|
49
|
+
def user_id
|
50
|
+
@attributes[:user_id]
|
51
|
+
end
|
52
|
+
|
53
|
+
def user_id=(value)
|
54
|
+
@attributes[:user_id] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# string - Absolute source path for the sync
|
58
|
+
def src_path
|
59
|
+
@attributes[:src_path]
|
60
|
+
end
|
61
|
+
|
62
|
+
def src_path=(value)
|
63
|
+
@attributes[:src_path] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# string - Absolute destination path for the sync
|
67
|
+
def dest_path
|
68
|
+
@attributes[:dest_path]
|
69
|
+
end
|
70
|
+
|
71
|
+
def dest_path=(value)
|
72
|
+
@attributes[:dest_path] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# int64 - Remote server ID for the source (if remote)
|
76
|
+
def src_remote_server_id
|
77
|
+
@attributes[:src_remote_server_id]
|
78
|
+
end
|
79
|
+
|
80
|
+
def src_remote_server_id=(value)
|
81
|
+
@attributes[:src_remote_server_id] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
# int64 - Remote server ID for the destination (if remote)
|
85
|
+
def dest_remote_server_id
|
86
|
+
@attributes[:dest_remote_server_id]
|
87
|
+
end
|
88
|
+
|
89
|
+
def dest_remote_server_id=(value)
|
90
|
+
@attributes[:dest_remote_server_id] = value
|
91
|
+
end
|
92
|
+
|
93
|
+
# boolean - Is this a two-way sync?
|
94
|
+
def two_way
|
95
|
+
@attributes[:two_way]
|
96
|
+
end
|
97
|
+
|
98
|
+
def two_way=(value)
|
99
|
+
@attributes[:two_way] = value
|
100
|
+
end
|
101
|
+
|
102
|
+
# boolean - Keep files after copying?
|
103
|
+
def keep_after_copy
|
104
|
+
@attributes[:keep_after_copy]
|
105
|
+
end
|
106
|
+
|
107
|
+
def keep_after_copy=(value)
|
108
|
+
@attributes[:keep_after_copy] = value
|
109
|
+
end
|
110
|
+
|
111
|
+
# boolean - Delete empty folders after sync?
|
112
|
+
def delete_empty_folders
|
113
|
+
@attributes[:delete_empty_folders]
|
114
|
+
end
|
115
|
+
|
116
|
+
def delete_empty_folders=(value)
|
117
|
+
@attributes[:delete_empty_folders] = value
|
118
|
+
end
|
119
|
+
|
120
|
+
# boolean - Is this sync disabled?
|
121
|
+
def disabled
|
122
|
+
@attributes[:disabled]
|
123
|
+
end
|
124
|
+
|
125
|
+
def disabled=(value)
|
126
|
+
@attributes[:disabled] = value
|
127
|
+
end
|
128
|
+
|
129
|
+
# 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`
|
130
|
+
def interval
|
131
|
+
@attributes[:interval]
|
132
|
+
end
|
133
|
+
|
134
|
+
def interval=(value)
|
135
|
+
@attributes[:interval] = value
|
136
|
+
end
|
137
|
+
|
138
|
+
# string - Trigger type: daily, custom_schedule, or manual
|
139
|
+
def trigger
|
140
|
+
@attributes[:trigger]
|
141
|
+
end
|
142
|
+
|
143
|
+
def trigger=(value)
|
144
|
+
@attributes[:trigger] = value
|
145
|
+
end
|
146
|
+
|
147
|
+
# 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.
|
148
|
+
def trigger_file
|
149
|
+
@attributes[:trigger_file]
|
150
|
+
end
|
151
|
+
|
152
|
+
def trigger_file=(value)
|
153
|
+
@attributes[:trigger_file] = value
|
154
|
+
end
|
155
|
+
|
156
|
+
# array(array) - Array of glob patterns to include
|
157
|
+
def include_patterns
|
158
|
+
@attributes[:include_patterns]
|
159
|
+
end
|
160
|
+
|
161
|
+
def include_patterns=(value)
|
162
|
+
@attributes[:include_patterns] = value
|
163
|
+
end
|
164
|
+
|
165
|
+
# array(array) - Array of glob patterns to exclude
|
166
|
+
def exclude_patterns
|
167
|
+
@attributes[:exclude_patterns]
|
168
|
+
end
|
169
|
+
|
170
|
+
def exclude_patterns=(value)
|
171
|
+
@attributes[:exclude_patterns] = value
|
172
|
+
end
|
173
|
+
|
174
|
+
# date-time - When this sync was created
|
175
|
+
def created_at
|
176
|
+
@attributes[:created_at]
|
177
|
+
end
|
178
|
+
|
179
|
+
# date-time - When this sync was last updated
|
180
|
+
def updated_at
|
181
|
+
@attributes[:updated_at]
|
182
|
+
end
|
183
|
+
|
184
|
+
# 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.
|
185
|
+
def sync_interval_minutes
|
186
|
+
@attributes[:sync_interval_minutes]
|
187
|
+
end
|
188
|
+
|
189
|
+
def sync_interval_minutes=(value)
|
190
|
+
@attributes[:sync_interval_minutes] = value
|
191
|
+
end
|
192
|
+
|
193
|
+
# int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
194
|
+
def recurring_day
|
195
|
+
@attributes[:recurring_day]
|
196
|
+
end
|
197
|
+
|
198
|
+
def recurring_day=(value)
|
199
|
+
@attributes[:recurring_day] = value
|
200
|
+
end
|
201
|
+
|
202
|
+
# 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.
|
203
|
+
def schedule_days_of_week
|
204
|
+
@attributes[:schedule_days_of_week]
|
205
|
+
end
|
206
|
+
|
207
|
+
def schedule_days_of_week=(value)
|
208
|
+
@attributes[:schedule_days_of_week] = value
|
209
|
+
end
|
210
|
+
|
211
|
+
# array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
|
212
|
+
def schedule_times_of_day
|
213
|
+
@attributes[:schedule_times_of_day]
|
214
|
+
end
|
215
|
+
|
216
|
+
def schedule_times_of_day=(value)
|
217
|
+
@attributes[:schedule_times_of_day] = value
|
218
|
+
end
|
219
|
+
|
220
|
+
# string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
221
|
+
def schedule_time_zone
|
222
|
+
@attributes[:schedule_time_zone]
|
223
|
+
end
|
224
|
+
|
225
|
+
def schedule_time_zone=(value)
|
226
|
+
@attributes[:schedule_time_zone] = value
|
227
|
+
end
|
228
|
+
|
229
|
+
# Parameters:
|
230
|
+
# name - string - Name for this sync job
|
231
|
+
# description - string - Description for this sync job
|
232
|
+
# src_path - string - Absolute source path
|
233
|
+
# dest_path - string - Absolute destination path
|
234
|
+
# src_remote_server_id - int64 - Remote server ID for the source
|
235
|
+
# dest_remote_server_id - int64 - Remote server ID for the destination
|
236
|
+
# two_way - boolean - Is this a two-way sync?
|
237
|
+
# keep_after_copy - boolean - Keep files after copying?
|
238
|
+
# delete_empty_folders - boolean - Delete empty folders after sync?
|
239
|
+
# disabled - boolean - Is this sync disabled?
|
240
|
+
# interval - int64 - Interval in minutes for sync (if scheduled)
|
241
|
+
# trigger - string - Trigger type: daily, custom_schedule, or manual
|
242
|
+
# 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.
|
243
|
+
# 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`.
|
244
|
+
# schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
245
|
+
# 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.
|
246
|
+
# 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.
|
247
|
+
def update(params = {})
|
248
|
+
params ||= {}
|
249
|
+
params[:id] = @attributes[:id]
|
250
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
251
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
252
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
253
|
+
raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
|
254
|
+
raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
|
255
|
+
raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
|
256
|
+
raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
|
257
|
+
raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
|
258
|
+
raise InvalidParameterError.new("Bad parameter: interval must be an Integer") if params[:interval] and !params[:interval].is_a?(Integer)
|
259
|
+
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
|
260
|
+
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
261
|
+
raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
|
262
|
+
raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
|
263
|
+
raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
|
264
|
+
raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
|
265
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
266
|
+
|
267
|
+
Api.send_request("/syncs/#{@attributes[:id]}", :patch, params, @options)
|
268
|
+
end
|
269
|
+
|
270
|
+
def delete(params = {})
|
271
|
+
params ||= {}
|
272
|
+
params[:id] = @attributes[:id]
|
273
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
274
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
275
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
276
|
+
|
277
|
+
Api.send_request("/syncs/#{@attributes[:id]}", :delete, params, @options)
|
278
|
+
end
|
279
|
+
|
280
|
+
def destroy(params = {})
|
281
|
+
delete(params)
|
282
|
+
nil
|
283
|
+
end
|
284
|
+
|
285
|
+
def save
|
286
|
+
if @attributes[:id]
|
287
|
+
new_obj = update(@attributes)
|
288
|
+
else
|
289
|
+
new_obj = Sync.create(@attributes, @options)
|
290
|
+
end
|
291
|
+
|
292
|
+
@attributes = new_obj.attributes
|
293
|
+
true
|
294
|
+
end
|
295
|
+
|
296
|
+
# Parameters:
|
297
|
+
# 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.
|
298
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
299
|
+
def self.list(params = {}, options = {})
|
300
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
301
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
302
|
+
|
303
|
+
List.new(Sync, params) do
|
304
|
+
Api.send_request("/syncs", :get, params, options)
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
def self.all(params = {}, options = {})
|
309
|
+
list(params, options)
|
310
|
+
end
|
311
|
+
|
312
|
+
# Parameters:
|
313
|
+
# id (required) - int64 - Sync ID.
|
314
|
+
def self.find(id, params = {}, options = {})
|
315
|
+
params ||= {}
|
316
|
+
params[:id] = id
|
317
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
318
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
319
|
+
|
320
|
+
response, options = Api.send_request("/syncs/#{params[:id]}", :get, params, options)
|
321
|
+
Sync.new(response.data, options)
|
322
|
+
end
|
323
|
+
|
324
|
+
def self.get(id, params = {}, options = {})
|
325
|
+
find(id, params, options)
|
326
|
+
end
|
327
|
+
|
328
|
+
# Parameters:
|
329
|
+
# name - string - Name for this sync job
|
330
|
+
# description - string - Description for this sync job
|
331
|
+
# src_path - string - Absolute source path
|
332
|
+
# dest_path - string - Absolute destination path
|
333
|
+
# src_remote_server_id - int64 - Remote server ID for the source
|
334
|
+
# dest_remote_server_id - int64 - Remote server ID for the destination
|
335
|
+
# two_way - boolean - Is this a two-way sync?
|
336
|
+
# keep_after_copy - boolean - Keep files after copying?
|
337
|
+
# delete_empty_folders - boolean - Delete empty folders after sync?
|
338
|
+
# disabled - boolean - Is this sync disabled?
|
339
|
+
# interval - int64 - Interval in minutes for sync (if scheduled)
|
340
|
+
# trigger - string - Trigger type: daily, custom_schedule, or manual
|
341
|
+
# 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.
|
342
|
+
# 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`.
|
343
|
+
# schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
344
|
+
# 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.
|
345
|
+
# 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.
|
346
|
+
def self.create(params = {}, options = {})
|
347
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
348
|
+
raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
|
349
|
+
raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
|
350
|
+
raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
|
351
|
+
raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
|
352
|
+
raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
|
353
|
+
raise InvalidParameterError.new("Bad parameter: interval must be an Integer") if params[:interval] and !params[:interval].is_a?(Integer)
|
354
|
+
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
|
355
|
+
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
356
|
+
raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
|
357
|
+
raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
|
358
|
+
raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
|
359
|
+
raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
|
360
|
+
|
361
|
+
response, options = Api.send_request("/syncs", :post, params, options)
|
362
|
+
Sync.new(response.data, options)
|
363
|
+
end
|
364
|
+
|
365
|
+
def self.create_migrate_to(params = {}, options = {})
|
366
|
+
Api.send_request("/syncs/migrate_to_syncs", :post, params, options)
|
367
|
+
nil
|
368
|
+
end
|
369
|
+
|
370
|
+
# Parameters:
|
371
|
+
# name - string - Name for this sync job
|
372
|
+
# description - string - Description for this sync job
|
373
|
+
# src_path - string - Absolute source path
|
374
|
+
# dest_path - string - Absolute destination path
|
375
|
+
# src_remote_server_id - int64 - Remote server ID for the source
|
376
|
+
# dest_remote_server_id - int64 - Remote server ID for the destination
|
377
|
+
# two_way - boolean - Is this a two-way sync?
|
378
|
+
# keep_after_copy - boolean - Keep files after copying?
|
379
|
+
# delete_empty_folders - boolean - Delete empty folders after sync?
|
380
|
+
# disabled - boolean - Is this sync disabled?
|
381
|
+
# interval - int64 - Interval in minutes for sync (if scheduled)
|
382
|
+
# trigger - string - Trigger type: daily, custom_schedule, or manual
|
383
|
+
# 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.
|
384
|
+
# 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`.
|
385
|
+
# schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
|
386
|
+
# 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.
|
387
|
+
# 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.
|
388
|
+
def self.update(id, params = {}, options = {})
|
389
|
+
params ||= {}
|
390
|
+
params[:id] = id
|
391
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
392
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
393
|
+
raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
|
394
|
+
raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
|
395
|
+
raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
|
396
|
+
raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
|
397
|
+
raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
|
398
|
+
raise InvalidParameterError.new("Bad parameter: interval must be an Integer") if params[:interval] and !params[:interval].is_a?(Integer)
|
399
|
+
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
|
400
|
+
raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
|
401
|
+
raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
|
402
|
+
raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
|
403
|
+
raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
|
404
|
+
raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
|
405
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
406
|
+
|
407
|
+
response, options = Api.send_request("/syncs/#{params[:id]}", :patch, params, options)
|
408
|
+
Sync.new(response.data, options)
|
409
|
+
end
|
410
|
+
|
411
|
+
def self.delete(id, params = {}, options = {})
|
412
|
+
params ||= {}
|
413
|
+
params[:id] = id
|
414
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
415
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
416
|
+
|
417
|
+
Api.send_request("/syncs/#{params[:id]}", :delete, params, options)
|
418
|
+
nil
|
419
|
+
end
|
420
|
+
|
421
|
+
def self.destroy(id, params = {}, options = {})
|
422
|
+
delete(id, params, options)
|
423
|
+
nil
|
424
|
+
end
|
425
|
+
end
|
426
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class SyncRun
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - SyncRun ID
|
13
|
+
def id
|
14
|
+
@attributes[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
# int64 - ID of the Sync this run belongs to
|
18
|
+
def sync_id
|
19
|
+
@attributes[:sync_id]
|
20
|
+
end
|
21
|
+
|
22
|
+
# int64 - Site ID
|
23
|
+
def site_id
|
24
|
+
@attributes[:site_id]
|
25
|
+
end
|
26
|
+
|
27
|
+
# string - Status of the sync run (success, failure, partial_failure, in_progress, skipped)
|
28
|
+
def status
|
29
|
+
@attributes[:status]
|
30
|
+
end
|
31
|
+
|
32
|
+
# string - Type of remote server used, if any
|
33
|
+
def remote_server_type
|
34
|
+
@attributes[:remote_server_type]
|
35
|
+
end
|
36
|
+
|
37
|
+
# string - Log or summary body for this run
|
38
|
+
def body
|
39
|
+
@attributes[:body]
|
40
|
+
end
|
41
|
+
|
42
|
+
# array(array) - Array of errors encountered during the run
|
43
|
+
def event_errors
|
44
|
+
@attributes[:event_errors]
|
45
|
+
end
|
46
|
+
|
47
|
+
# int64 - Total bytes synced in this run
|
48
|
+
def bytes_synced
|
49
|
+
@attributes[:bytes_synced]
|
50
|
+
end
|
51
|
+
|
52
|
+
# int64 - Number of files compared
|
53
|
+
def compared_files
|
54
|
+
@attributes[:compared_files]
|
55
|
+
end
|
56
|
+
|
57
|
+
# int64 - Number of folders compared
|
58
|
+
def compared_folders
|
59
|
+
@attributes[:compared_folders]
|
60
|
+
end
|
61
|
+
|
62
|
+
# int64 - Number of files that errored
|
63
|
+
def errored_files
|
64
|
+
@attributes[:errored_files]
|
65
|
+
end
|
66
|
+
|
67
|
+
# int64 - Number of files successfully synced
|
68
|
+
def successful_files
|
69
|
+
@attributes[:successful_files]
|
70
|
+
end
|
71
|
+
|
72
|
+
# float - Total runtime in seconds
|
73
|
+
def runtime
|
74
|
+
@attributes[:runtime]
|
75
|
+
end
|
76
|
+
|
77
|
+
# string - S3 path to the main log file
|
78
|
+
def s3_body_path
|
79
|
+
@attributes[:s3_body_path]
|
80
|
+
end
|
81
|
+
|
82
|
+
# string - S3 path to the internal log file
|
83
|
+
def s3_internal_body_path
|
84
|
+
@attributes[:s3_internal_body_path]
|
85
|
+
end
|
86
|
+
|
87
|
+
# date-time - When this run was completed
|
88
|
+
def completed_at
|
89
|
+
@attributes[:completed_at]
|
90
|
+
end
|
91
|
+
|
92
|
+
# boolean - Whether notifications were sent for this run
|
93
|
+
def notified
|
94
|
+
@attributes[:notified]
|
95
|
+
end
|
96
|
+
|
97
|
+
# date-time - When this run was created
|
98
|
+
def created_at
|
99
|
+
@attributes[:created_at]
|
100
|
+
end
|
101
|
+
|
102
|
+
# date-time - When this run was last updated
|
103
|
+
def updated_at
|
104
|
+
@attributes[:updated_at]
|
105
|
+
end
|
106
|
+
|
107
|
+
# Parameters:
|
108
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
109
|
+
# 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.
|
110
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
111
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `sync_id`, `created_at` or `status`.
|
112
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `sync_id`. Valid field combinations are `[ sync_id, status ]`.
|
113
|
+
# sync_id (required) - int64 - ID of the Sync this run belongs to
|
114
|
+
def self.list(params = {}, options = {})
|
115
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
|
116
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
117
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
118
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
119
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
120
|
+
raise InvalidParameterError.new("Bad parameter: sync_id must be an Integer") if params[:sync_id] and !params[:sync_id].is_a?(Integer)
|
121
|
+
raise MissingParameterError.new("Parameter missing: sync_id") unless params[:sync_id]
|
122
|
+
|
123
|
+
List.new(SyncRun, params) do
|
124
|
+
Api.send_request("/sync_runs", :get, params, options)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.all(params = {}, options = {})
|
129
|
+
list(params, options)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Parameters:
|
133
|
+
# id (required) - int64 - Sync Run ID.
|
134
|
+
def self.find(id, params = {}, options = {})
|
135
|
+
params ||= {}
|
136
|
+
params[:id] = id
|
137
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
138
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
139
|
+
|
140
|
+
response, options = Api.send_request("/sync_runs/#{params[:id]}", :get, params, options)
|
141
|
+
SyncRun.new(response.data, options)
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.get(id, params = {}, options = {})
|
145
|
+
find(id, params, options)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
data/lib/files.com/version.rb
CHANGED
data/lib/files.com.rb
CHANGED
@@ -120,7 +120,9 @@ require "files.com/models/snapshot"
|
|
120
120
|
require "files.com/models/sso_strategy"
|
121
121
|
require "files.com/models/status"
|
122
122
|
require "files.com/models/style"
|
123
|
+
require "files.com/models/sync"
|
123
124
|
require "files.com/models/sync_log"
|
125
|
+
require "files.com/models/sync_run"
|
124
126
|
require "files.com/models/usage_by_top_level_dir"
|
125
127
|
require "files.com/models/usage_daily_snapshot"
|
126
128
|
require "files.com/models/usage_snapshot"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: files.com
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.268
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -203,7 +203,9 @@ files:
|
|
203
203
|
- docs/sso_strategy.md
|
204
204
|
- docs/status.md
|
205
205
|
- docs/style.md
|
206
|
+
- docs/sync.md
|
206
207
|
- docs/sync_log.md
|
208
|
+
- docs/sync_run.md
|
207
209
|
- docs/usage_by_top_level_dir.md
|
208
210
|
- docs/usage_daily_snapshot.md
|
209
211
|
- docs/usage_snapshot.md
|
@@ -310,7 +312,9 @@ files:
|
|
310
312
|
- lib/files.com/models/sso_strategy.rb
|
311
313
|
- lib/files.com/models/status.rb
|
312
314
|
- lib/files.com/models/style.rb
|
315
|
+
- lib/files.com/models/sync.rb
|
313
316
|
- lib/files.com/models/sync_log.rb
|
317
|
+
- lib/files.com/models/sync_run.rb
|
314
318
|
- lib/files.com/models/usage_by_top_level_dir.rb
|
315
319
|
- lib/files.com/models/usage_daily_snapshot.rb
|
316
320
|
- lib/files.com/models/usage_snapshot.rb
|