files.com 1.0.194 → 1.0.195

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52e8b147899182724aac0a39cce4686d5a189e792a55c54dec5a95cd91cf7f28
4
- data.tar.gz: 14b7b48c0c9521abd46c6951a2ebd5e982efbb0f9d8ea9fa34eedb3316b3a457
3
+ metadata.gz: dfd2b87e6b2899068127a47e5fc6ddbd87588145008666cbb590b2fb76fd58ab
4
+ data.tar.gz: dd2e605258357b602b9c61e2800b0558d24a2e11908be6c2093f502b5703fb43
5
5
  SHA512:
6
- metadata.gz: eb81521f063321a22a896ae4cd8d55203bb16b8f7bb53a995b53e439dc51da1e5ff6c6029011bdaddf00b8467ecf2a311abe1f1e53425d1929f6052d4234207a
7
- data.tar.gz: '02509eb316fca99ee450a28a3862d1ec2dc1e87ddac4b376e6d027c8732f4909f716d80d10893d3a5106fb7d30322e36c467c4f975bcc61815a32c08634cf552'
6
+ metadata.gz: acc6265109d04edf138edc5f9437ec5694fa12b3d4c87eae42ed9275c134bb773d9a404cc6b50090173aeaa0f77de5818950d3a1f4a1504aed351cf83941a653
7
+ data.tar.gz: 9692d7bec084adddb8ab1c151141698447c7327b15ffd6a27f06824c81a911076931b415cd378281852d89ed5ee7e30726339ccb833dc1a799d0eabdbbd985b4
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.194
1
+ 1.0.195
data/docs/behavior.md CHANGED
@@ -101,7 +101,7 @@ Files::Behavior.create(
101
101
 
102
102
  ### Parameters
103
103
 
104
- * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
104
+ * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
105
105
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
106
106
  * `path` (string): Required - Folder behaviors path.
107
107
  * `behavior` (string): Required - Behavior type.
@@ -146,7 +146,7 @@ Files::Behavior.update(id,
146
146
  ### Parameters
147
147
 
148
148
  * `id` (int64): Required - Behavior ID.
149
- * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
149
+ * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
150
150
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
151
151
  * `behavior` (string): Behavior type.
152
152
  * `path` (string): Folder behaviors path.
@@ -181,7 +181,7 @@ behavior.update(
181
181
  ### Parameters
182
182
 
183
183
  * `id` (int64): Required - Behavior ID.
184
- * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
184
+ * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
185
185
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
186
186
  * `behavior` (string): Behavior type.
187
187
  * `path` (string): Folder behaviors path.
data/docs/file.md CHANGED
@@ -148,6 +148,85 @@ Files::File.delete(path,
148
148
  * `recursive` (boolean): If true, will recursively delete folers. Otherwise, will error on non-empty folders.
149
149
 
150
150
 
151
+ ---
152
+
153
+ ## Return metadata for file/folder
154
+
155
+ ```
156
+ Files::File.metadata(path,
157
+ with_previews: true,
158
+ with_priority_color: true
159
+ )
160
+ ```
161
+
162
+ ### Parameters
163
+
164
+ * `path` (string): Required - Path to operate on.
165
+ * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
166
+ * `with_previews` (boolean): Include file preview information?
167
+ * `with_priority_color` (boolean): Include file priority color information?
168
+
169
+
170
+ ---
171
+
172
+ ## Copy file/folder
173
+
174
+ ```
175
+ Files::File.copy(path,
176
+ destination: "destination",
177
+ structure: true
178
+ )
179
+ ```
180
+
181
+ ### Parameters
182
+
183
+ * `path` (string): Required - Path to operate on.
184
+ * `destination` (string): Required - Copy destination path.
185
+ * `structure` (boolean): Copy structure only?
186
+
187
+
188
+ ---
189
+
190
+ ## Move file/folder
191
+
192
+ ```
193
+ Files::File.move(path,
194
+ destination: "destination"
195
+ )
196
+ ```
197
+
198
+ ### Parameters
199
+
200
+ * `path` (string): Required - Path to operate on.
201
+ * `destination` (string): Required - Move destination path.
202
+
203
+
204
+ ---
205
+
206
+ ## Begin file upload
207
+
208
+ ```
209
+ Files::File.begin_upload(path,
210
+ mkdir_parents: true,
211
+ part: 1,
212
+ parts: 1,
213
+ ref: "upload-1",
214
+ restart: 1,
215
+ with_rename: true
216
+ )
217
+ ```
218
+
219
+ ### Parameters
220
+
221
+ * `path` (string): Required - Path to operate on.
222
+ * `mkdir_parents` (boolean): Create parent directories if they do not exist?
223
+ * `part` (int64): Part if uploading a part.
224
+ * `parts` (int64): How many parts to fetch?
225
+ * `ref` (string):
226
+ * `restart` (int64): File byte offset to restart from.
227
+ * `with_rename` (boolean): Allow file rename instead of overwrite?
228
+
229
+
151
230
  ---
152
231
 
153
232
  ## Download file
@@ -206,3 +285,90 @@ file.delete(
206
285
 
207
286
  * `path` (string): Required - Path to operate on.
208
287
  * `recursive` (boolean): If true, will recursively delete folers. Otherwise, will error on non-empty folders.
288
+
289
+
290
+ ---
291
+
292
+ ## Return metadata for file/folder
293
+
294
+ ```
295
+ file = Files::File.list_for(path).first
296
+
297
+ file.metadata(
298
+ with_previews: true,
299
+ with_priority_color: true
300
+ )
301
+ ```
302
+
303
+ ### Parameters
304
+
305
+ * `path` (string): Required - Path to operate on.
306
+ * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
307
+ * `with_previews` (boolean): Include file preview information?
308
+ * `with_priority_color` (boolean): Include file priority color information?
309
+
310
+
311
+ ---
312
+
313
+ ## Copy file/folder
314
+
315
+ ```
316
+ file = Files::File.list_for(path).first
317
+
318
+ file.copy(
319
+ destination: "destination",
320
+ structure: true
321
+ )
322
+ ```
323
+
324
+ ### Parameters
325
+
326
+ * `path` (string): Required - Path to operate on.
327
+ * `destination` (string): Required - Copy destination path.
328
+ * `structure` (boolean): Copy structure only?
329
+
330
+
331
+ ---
332
+
333
+ ## Move file/folder
334
+
335
+ ```
336
+ file = Files::File.list_for(path).first
337
+
338
+ file.move(
339
+ destination: "destination"
340
+ )
341
+ ```
342
+
343
+ ### Parameters
344
+
345
+ * `path` (string): Required - Path to operate on.
346
+ * `destination` (string): Required - Move destination path.
347
+
348
+
349
+ ---
350
+
351
+ ## Begin file upload
352
+
353
+ ```
354
+ file = Files::File.list_for(path).first
355
+
356
+ file.begin_upload(
357
+ mkdir_parents: true,
358
+ part: 1,
359
+ parts: 1,
360
+ ref: "upload-1",
361
+ restart: 1,
362
+ with_rename: true
363
+ )
364
+ ```
365
+
366
+ ### Parameters
367
+
368
+ * `path` (string): Required - Path to operate on.
369
+ * `mkdir_parents` (boolean): Create parent directories if they do not exist?
370
+ * `part` (int64): Part if uploading a part.
371
+ * `parts` (int64): How many parts to fetch?
372
+ * `ref` (string):
373
+ * `restart` (int64): File byte offset to restart from.
374
+ * `with_rename` (boolean): Allow file rename instead of overwrite?
data/docs/file_action.md CHANGED
@@ -11,129 +11,3 @@
11
11
 
12
12
  * `status` (string): Status of file operation. Possible values: completed, enqueued.
13
13
  * `file_migration_id` (int64): If status is enqueued, this is the id of the FileMigration to check for status updates.
14
-
15
-
16
- ---
17
-
18
- ## Copy file/folder
19
-
20
- ```
21
- Files::FileAction.copy(path,
22
- destination: "destination",
23
- structure: true
24
- )
25
- ```
26
-
27
- ### Parameters
28
-
29
- * `path` (string): Required - Path to operate on.
30
- * `destination` (string): Required - Copy destination path.
31
- * `structure` (boolean): Copy structure only?
32
-
33
-
34
- ---
35
-
36
- ## Move file/folder
37
-
38
- ```
39
- Files::FileAction.move(path,
40
- destination: "destination"
41
- )
42
- ```
43
-
44
- ### Parameters
45
-
46
- * `path` (string): Required - Path to operate on.
47
- * `destination` (string): Required - Move destination path.
48
-
49
-
50
- ---
51
-
52
- ## Begin file upload
53
-
54
- ```
55
- Files::FileAction.begin_upload(path,
56
- mkdir_parents: true,
57
- part: 1,
58
- parts: 1,
59
- ref: "upload-1",
60
- restart: 1,
61
- with_rename: true
62
- )
63
- ```
64
-
65
- ### Parameters
66
-
67
- * `path` (string): Required - Path to operate on.
68
- * `mkdir_parents` (boolean): Create parent directories if they do not exist?
69
- * `part` (int64): Part if uploading a part.
70
- * `parts` (int64): How many parts to fetch?
71
- * `ref` (string):
72
- * `restart` (int64): File byte offset to restart from.
73
- * `with_rename` (boolean): Allow file rename instead of overwrite?
74
-
75
-
76
- ---
77
-
78
- ## Copy file/folder
79
-
80
- ```
81
- file_action = Files::FileAction.list_for(path).first
82
-
83
- file_action.copy(
84
- destination: "destination",
85
- structure: true
86
- )
87
- ```
88
-
89
- ### Parameters
90
-
91
- * `path` (string): Required - Path to operate on.
92
- * `destination` (string): Required - Copy destination path.
93
- * `structure` (boolean): Copy structure only?
94
-
95
-
96
- ---
97
-
98
- ## Move file/folder
99
-
100
- ```
101
- file_action = Files::FileAction.list_for(path).first
102
-
103
- file_action.move(
104
- destination: "destination"
105
- )
106
- ```
107
-
108
- ### Parameters
109
-
110
- * `path` (string): Required - Path to operate on.
111
- * `destination` (string): Required - Move destination path.
112
-
113
-
114
- ---
115
-
116
- ## Begin file upload
117
-
118
- ```
119
- file_action = Files::FileAction.list_for(path).first
120
-
121
- file_action.begin_upload(
122
- mkdir_parents: true,
123
- part: 1,
124
- parts: 1,
125
- ref: "upload-1",
126
- restart: 1,
127
- with_rename: true
128
- )
129
- ```
130
-
131
- ### Parameters
132
-
133
- * `path` (string): Required - Path to operate on.
134
- * `mkdir_parents` (boolean): Create parent directories if they do not exist?
135
- * `part` (int64): Part if uploading a part.
136
- * `parts` (int64): How many parts to fetch?
137
- * `ref` (string):
138
- * `restart` (int64): File byte offset to restart from.
139
- * `with_rename` (boolean): Allow file rename instead of overwrite?
@@ -11,7 +11,8 @@
11
11
  "files_total": 1,
12
12
  "operation": "move",
13
13
  "region": "USA",
14
- "status": "complete"
14
+ "status": "complete",
15
+ "log_url": "https://www.example.com/log_file"
15
16
  }
16
17
  ```
17
18
 
@@ -23,6 +24,7 @@
23
24
  * `operation` (string): The type of operation
24
25
  * `region` (string): Region
25
26
  * `status` (string): Status
27
+ * `log_url` (string): Link to download the log file for this migration.
26
28
 
27
29
 
28
30
  ---
@@ -64,7 +64,7 @@ module Files
64
64
  end
65
65
 
66
66
  # Parameters:
67
- # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
67
+ # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
68
68
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
69
69
  # behavior - string - Behavior type.
70
70
  # path - string - Folder behaviors path.
@@ -188,7 +188,7 @@ module Files
188
188
  end
189
189
 
190
190
  # Parameters:
191
- # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
191
+ # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
192
192
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
193
193
  # path (required) - string - Folder behaviors path.
194
194
  # behavior (required) - string - Behavior type.
@@ -224,7 +224,7 @@ module Files
224
224
  end
225
225
 
226
226
  # Parameters:
227
- # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
227
+ # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
228
228
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
229
229
  # behavior - string - Behavior type.
230
230
  # path - string - Folder behaviors path.
@@ -863,6 +863,79 @@ module Files
863
863
  delete(params)
864
864
  end
865
865
 
866
+ # Return metadata for file/folder
867
+ #
868
+ # Parameters:
869
+ # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
870
+ # with_previews - boolean - Include file preview information?
871
+ # with_priority_color - boolean - Include file priority color information?
872
+ def metadata(params = {})
873
+ params ||= {}
874
+ params[:path] = @attributes[:path]
875
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
876
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
877
+ raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
878
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
879
+
880
+ Api.send_request("/file_actions/metadata/#{@attributes[:path]}", :get, params, @options)
881
+ end
882
+
883
+ # Copy file/folder
884
+ #
885
+ # Parameters:
886
+ # destination (required) - string - Copy destination path.
887
+ # structure - boolean - Copy structure only?
888
+ def copy(params = {})
889
+ params ||= {}
890
+ params[:path] = @attributes[:path]
891
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
892
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
893
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
894
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
895
+ raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
896
+
897
+ Api.send_request("/file_actions/copy/#{@attributes[:path]}", :post, params, @options)
898
+ end
899
+
900
+ # Move file/folder
901
+ #
902
+ # Parameters:
903
+ # destination (required) - string - Move destination path.
904
+ def move(params = {})
905
+ params ||= {}
906
+ params[:path] = @attributes[:path]
907
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
908
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
909
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
910
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
911
+ raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
912
+
913
+ Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
914
+ end
915
+
916
+ # Begin file upload
917
+ #
918
+ # Parameters:
919
+ # mkdir_parents - boolean - Create parent directories if they do not exist?
920
+ # part - int64 - Part if uploading a part.
921
+ # parts - int64 - How many parts to fetch?
922
+ # ref - string -
923
+ # restart - int64 - File byte offset to restart from.
924
+ # with_rename - boolean - Allow file rename instead of overwrite?
925
+ def begin_upload(params = {})
926
+ params ||= {}
927
+ params[:path] = @attributes[:path]
928
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
929
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
930
+ raise InvalidParameterError.new("Bad parameter: part must be an Integer") if params.dig(:part) and !params.dig(:part).is_a?(Integer)
931
+ raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if params.dig(:parts) and !params.dig(:parts).is_a?(Integer)
932
+ raise InvalidParameterError.new("Bad parameter: ref must be an String") if params.dig(:ref) and !params.dig(:ref).is_a?(String)
933
+ raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
934
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
935
+
936
+ Api.send_request("/file_actions/begin_upload/#{@attributes[:path]}", :post, params, @options)
937
+ end
938
+
866
939
  def save
867
940
  new_obj = File.create(path, @attributes, @options)
868
941
  @attributes = new_obj.attributes
@@ -951,5 +1024,80 @@ module Files
951
1024
  def self.destroy(path, params = {}, options = {})
952
1025
  delete(path, params, options)
953
1026
  end
1027
+
1028
+ # Return metadata for file/folder
1029
+ #
1030
+ # Parameters:
1031
+ # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
1032
+ # with_previews - boolean - Include file preview information?
1033
+ # with_priority_color - boolean - Include file priority color information?
1034
+ def self.metadata(path, params = {}, options = {})
1035
+ params ||= {}
1036
+ params[:path] = path
1037
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
1038
+ raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
1039
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
1040
+
1041
+ response, options = Api.send_request("/file_actions/metadata/#{params[:path]}", :get, params, options)
1042
+ File.new(response.data, options)
1043
+ end
1044
+
1045
+ # Copy file/folder
1046
+ #
1047
+ # Parameters:
1048
+ # destination (required) - string - Copy destination path.
1049
+ # structure - boolean - Copy structure only?
1050
+ def self.copy(path, params = {}, options = {})
1051
+ params ||= {}
1052
+ params[:path] = path
1053
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
1054
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
1055
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
1056
+ raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
1057
+
1058
+ response, options = Api.send_request("/file_actions/copy/#{params[:path]}", :post, params, options)
1059
+ FileAction.new(response.data, options)
1060
+ end
1061
+
1062
+ # Move file/folder
1063
+ #
1064
+ # Parameters:
1065
+ # destination (required) - string - Move destination path.
1066
+ def self.move(path, params = {}, options = {})
1067
+ params ||= {}
1068
+ params[:path] = path
1069
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
1070
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
1071
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
1072
+ raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
1073
+
1074
+ response, options = Api.send_request("/file_actions/move/#{params[:path]}", :post, params, options)
1075
+ FileAction.new(response.data, options)
1076
+ end
1077
+
1078
+ # Begin file upload
1079
+ #
1080
+ # Parameters:
1081
+ # mkdir_parents - boolean - Create parent directories if they do not exist?
1082
+ # part - int64 - Part if uploading a part.
1083
+ # parts - int64 - How many parts to fetch?
1084
+ # ref - string -
1085
+ # restart - int64 - File byte offset to restart from.
1086
+ # with_rename - boolean - Allow file rename instead of overwrite?
1087
+ def self.begin_upload(path, params = {}, options = {})
1088
+ params ||= {}
1089
+ params[:path] = path
1090
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
1091
+ raise InvalidParameterError.new("Bad parameter: part must be an Integer") if params.dig(:part) and !params.dig(:part).is_a?(Integer)
1092
+ raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if params.dig(:parts) and !params.dig(:parts).is_a?(Integer)
1093
+ raise InvalidParameterError.new("Bad parameter: ref must be an String") if params.dig(:ref) and !params.dig(:ref).is_a?(String)
1094
+ raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
1095
+ raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
1096
+
1097
+ response, options = Api.send_request("/file_actions/begin_upload/#{params[:path]}", :post, params, options)
1098
+ response.data.map do |entity_data|
1099
+ FileUploadPart.new(entity_data, options)
1100
+ end
1101
+ end
954
1102
  end
955
1103
  end
@@ -18,119 +18,5 @@ module Files
18
18
  def file_migration_id
19
19
  @attributes[:file_migration_id]
20
20
  end
21
-
22
- # Copy file/folder
23
- #
24
- # Parameters:
25
- # destination (required) - string - Copy destination path.
26
- # structure - boolean - Copy structure only?
27
- def copy(params = {})
28
- params ||= {}
29
- params[:path] = @attributes[:path]
30
- raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
31
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
32
- raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
33
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
34
- raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
35
-
36
- Api.send_request("/file_actions/copy/#{@attributes[:path]}", :post, params, @options)
37
- end
38
-
39
- # Move file/folder
40
- #
41
- # Parameters:
42
- # destination (required) - string - Move destination path.
43
- def move(params = {})
44
- params ||= {}
45
- params[:path] = @attributes[:path]
46
- raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
47
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
48
- raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
49
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
50
- raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
51
-
52
- Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
53
- end
54
-
55
- # Begin file upload
56
- #
57
- # Parameters:
58
- # mkdir_parents - boolean - Create parent directories if they do not exist?
59
- # part - int64 - Part if uploading a part.
60
- # parts - int64 - How many parts to fetch?
61
- # ref - string -
62
- # restart - int64 - File byte offset to restart from.
63
- # with_rename - boolean - Allow file rename instead of overwrite?
64
- def begin_upload(params = {})
65
- params ||= {}
66
- params[:path] = @attributes[:path]
67
- raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
68
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
69
- raise InvalidParameterError.new("Bad parameter: part must be an Integer") if params.dig(:part) and !params.dig(:part).is_a?(Integer)
70
- raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if params.dig(:parts) and !params.dig(:parts).is_a?(Integer)
71
- raise InvalidParameterError.new("Bad parameter: ref must be an String") if params.dig(:ref) and !params.dig(:ref).is_a?(String)
72
- raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
73
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
74
-
75
- Api.send_request("/file_actions/begin_upload/#{@attributes[:path]}", :post, params, @options)
76
- end
77
-
78
- # Copy file/folder
79
- #
80
- # Parameters:
81
- # destination (required) - string - Copy destination path.
82
- # structure - boolean - Copy structure only?
83
- def self.copy(path, params = {}, options = {})
84
- params ||= {}
85
- params[:path] = path
86
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
87
- raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
88
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
89
- raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
90
-
91
- response, options = Api.send_request("/file_actions/copy/#{params[:path]}", :post, params, options)
92
- FileAction.new(response.data, options)
93
- end
94
-
95
- # Move file/folder
96
- #
97
- # Parameters:
98
- # destination (required) - string - Move destination path.
99
- def self.move(path, params = {}, options = {})
100
- params ||= {}
101
- params[:path] = path
102
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
103
- raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
104
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
105
- raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
106
-
107
- response, options = Api.send_request("/file_actions/move/#{params[:path]}", :post, params, options)
108
- FileAction.new(response.data, options)
109
- end
110
-
111
- # Begin file upload
112
- #
113
- # Parameters:
114
- # mkdir_parents - boolean - Create parent directories if they do not exist?
115
- # part - int64 - Part if uploading a part.
116
- # parts - int64 - How many parts to fetch?
117
- # ref - string -
118
- # restart - int64 - File byte offset to restart from.
119
- # with_rename - boolean - Allow file rename instead of overwrite?
120
- def self.begin_upload(path, params = {}, options = {})
121
- params ||= {}
122
- params[:path] = path
123
- raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
124
- raise InvalidParameterError.new("Bad parameter: part must be an Integer") if params.dig(:part) and !params.dig(:part).is_a?(Integer)
125
- raise InvalidParameterError.new("Bad parameter: parts must be an Integer") if params.dig(:parts) and !params.dig(:parts).is_a?(Integer)
126
- raise InvalidParameterError.new("Bad parameter: ref must be an String") if params.dig(:ref) and !params.dig(:ref).is_a?(String)
127
- raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
128
- raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
129
-
130
- response, options = Api.send_request("/file_actions/begin_upload/#{params[:path]}", :post, params, options)
131
- response.data.map do |entity_data|
132
- FileUploadPart.new(entity_data, options)
133
- end
134
- end
135
21
  end
136
22
  end
@@ -49,6 +49,11 @@ module Files
49
49
  @attributes[:status]
50
50
  end
51
51
 
52
+ # string - Link to download the log file for this migration.
53
+ def log_url
54
+ @attributes[:log_url]
55
+ end
56
+
52
57
  # Parameters:
53
58
  # id (required) - int64 - File Migration ID.
54
59
  def self.find(id, params = {}, options = {})
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.0.194
4
+ version: 1.0.195
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-06 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable