files.com 1.0.183 → 1.0.187
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/file_migration.md +38 -0
- data/docs/lock.md +17 -5
- data/lib/files.com.rb +1 -0
- data/lib/files.com/models/file_migration.rb +68 -0
- data/lib/files.com/models/lock.rb +36 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d5bb31875a4586b91754ab369dcc86a3c2fa37eeddca9dda476087512aed6a1
|
4
|
+
data.tar.gz: ad6d4e2eca2914934aa18edeca1eeee889e0166b3cc8dd1086aa3a320f070bad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b514f80a52e9294e7c83ffd9b54ead85793adfb0d6072b1891893c1380beea2c02043208a099f87969fe890a93c4fc90f324d4fbdc27e3927eaa53eeaa7f660
|
7
|
+
data.tar.gz: 54ef9dde013fa812864094a5aeed693792e719c1fc3288b8ea134504af316bcd5bc737f3a6ef764ffcdee313d3024975bb9a941d5ff1112e7b74d05f423181b1
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.187
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# FileMigration
|
2
|
+
|
3
|
+
## Example FileMigration Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"id": 1,
|
8
|
+
"path": "MyFolder",
|
9
|
+
"dest_path": "MyFolder",
|
10
|
+
"files_moved": 1,
|
11
|
+
"files_total": 1,
|
12
|
+
"operation": "move",
|
13
|
+
"region": "USA",
|
14
|
+
"status": "complete"
|
15
|
+
}
|
16
|
+
```
|
17
|
+
|
18
|
+
* `id` (int64): File migration ID
|
19
|
+
* `path` (string): Source path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
20
|
+
* `dest_path` (string): Destination path
|
21
|
+
* `files_moved` (int64): Number of files processed
|
22
|
+
* `files_total` (int64): Total number of files to process
|
23
|
+
* `operation` (string): The type of operation
|
24
|
+
* `region` (string): Region
|
25
|
+
* `status` (string): Status
|
26
|
+
|
27
|
+
|
28
|
+
---
|
29
|
+
|
30
|
+
## Show File Migration
|
31
|
+
|
32
|
+
```
|
33
|
+
Files::FileMigration.find(id)
|
34
|
+
```
|
35
|
+
|
36
|
+
### Parameters
|
37
|
+
|
38
|
+
* `id` (int64): Required - File Migration ID.
|
data/docs/lock.md
CHANGED
@@ -7,22 +7,28 @@
|
|
7
7
|
"path": "locked_file",
|
8
8
|
"timeout": 43200,
|
9
9
|
"depth": "infinity",
|
10
|
+
"recursive": true,
|
10
11
|
"owner": "user",
|
11
12
|
"scope": "shared",
|
13
|
+
"exclusive": true,
|
12
14
|
"token": "17c54824e9931a4688ca032d03f6663c",
|
13
15
|
"type": "write",
|
16
|
+
"allow_access_by_any_user": true,
|
14
17
|
"user_id": 1,
|
15
18
|
"username": ""
|
16
19
|
}
|
17
20
|
```
|
18
21
|
|
19
22
|
* `path` (string): Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
20
|
-
* `timeout` (int64): Lock timeout
|
21
|
-
* `depth` (string): Lock depth
|
22
|
-
* `
|
23
|
-
* `
|
23
|
+
* `timeout` (int64): Lock timeout in seconds
|
24
|
+
* `depth` (string): DEPRECATED: Lock depth
|
25
|
+
* `recursive` (boolean): Does lock apply to subfolders?
|
26
|
+
* `owner` (string): Owner of the lock. This can be any arbitrary string.
|
27
|
+
* `scope` (string): DEPRECATED: Lock scope
|
28
|
+
* `exclusive` (boolean): Is lock exclusive?
|
24
29
|
* `token` (string): Lock token. Use to release lock.
|
25
|
-
* `type` (string): Lock type
|
30
|
+
* `type` (string): DEPRECATED: Lock type
|
31
|
+
* `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator?
|
26
32
|
* `user_id` (int64): Lock creator user ID
|
27
33
|
* `username` (string): Lock creator username
|
28
34
|
|
@@ -52,6 +58,9 @@ Files::Lock.list_for(path,
|
|
52
58
|
|
53
59
|
```
|
54
60
|
Files::Lock.create(path,
|
61
|
+
allow_access_by_any_user: true,
|
62
|
+
exclusive: true,
|
63
|
+
recursive: true,
|
55
64
|
timeout: 1
|
56
65
|
)
|
57
66
|
```
|
@@ -59,6 +68,9 @@ Files::Lock.create(path,
|
|
59
68
|
### Parameters
|
60
69
|
|
61
70
|
* `path` (string): Required - Path
|
71
|
+
* `allow_access_by_any_user` (boolean): Allow lock to be updated by any user?
|
72
|
+
* `exclusive` (boolean): Is lock exclusive?
|
73
|
+
* `recursive` (string): Does lock apply to subfolders?
|
62
74
|
* `timeout` (int64): Lock timeout length
|
63
75
|
|
64
76
|
|
data/lib/files.com.rb
CHANGED
@@ -51,6 +51,7 @@ require "files.com/models/file"
|
|
51
51
|
require "files.com/models/file_action"
|
52
52
|
require "files.com/models/file_comment"
|
53
53
|
require "files.com/models/file_comment_reaction"
|
54
|
+
require "files.com/models/file_migration"
|
54
55
|
require "files.com/models/file_upload_part"
|
55
56
|
require "files.com/models/folder"
|
56
57
|
require "files.com/models/form_field"
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class FileMigration
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - File migration ID
|
13
|
+
def id
|
14
|
+
@attributes[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
# string - Source path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
18
|
+
def path
|
19
|
+
@attributes[:path]
|
20
|
+
end
|
21
|
+
|
22
|
+
# string - Destination path
|
23
|
+
def dest_path
|
24
|
+
@attributes[:dest_path]
|
25
|
+
end
|
26
|
+
|
27
|
+
# int64 - Number of files processed
|
28
|
+
def files_moved
|
29
|
+
@attributes[:files_moved]
|
30
|
+
end
|
31
|
+
|
32
|
+
# int64 - Total number of files to process
|
33
|
+
def files_total
|
34
|
+
@attributes[:files_total]
|
35
|
+
end
|
36
|
+
|
37
|
+
# string - The type of operation
|
38
|
+
def operation
|
39
|
+
@attributes[:operation]
|
40
|
+
end
|
41
|
+
|
42
|
+
# string - Region
|
43
|
+
def region
|
44
|
+
@attributes[:region]
|
45
|
+
end
|
46
|
+
|
47
|
+
# string - Status
|
48
|
+
def status
|
49
|
+
@attributes[:status]
|
50
|
+
end
|
51
|
+
|
52
|
+
# Parameters:
|
53
|
+
# id (required) - int64 - File Migration ID.
|
54
|
+
def self.find(id, params = {}, options = {})
|
55
|
+
params ||= {}
|
56
|
+
params[:id] = id
|
57
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
58
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
59
|
+
|
60
|
+
response, options = Api.send_request("/file_migrations/#{params[:id]}", :get, params, options)
|
61
|
+
FileMigration.new(response.data, options)
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.get(id, params = {}, options = {})
|
65
|
+
find(id, params, options)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -18,7 +18,7 @@ module Files
|
|
18
18
|
@attributes[:path] = value
|
19
19
|
end
|
20
20
|
|
21
|
-
# int64 - Lock timeout
|
21
|
+
# int64 - Lock timeout in seconds
|
22
22
|
def timeout
|
23
23
|
@attributes[:timeout]
|
24
24
|
end
|
@@ -27,7 +27,7 @@ module Files
|
|
27
27
|
@attributes[:timeout] = value
|
28
28
|
end
|
29
29
|
|
30
|
-
# string - Lock depth
|
30
|
+
# string - DEPRECATED: Lock depth
|
31
31
|
def depth
|
32
32
|
@attributes[:depth]
|
33
33
|
end
|
@@ -36,7 +36,16 @@ module Files
|
|
36
36
|
@attributes[:depth] = value
|
37
37
|
end
|
38
38
|
|
39
|
-
#
|
39
|
+
# boolean - Does lock apply to subfolders?
|
40
|
+
def recursive
|
41
|
+
@attributes[:recursive]
|
42
|
+
end
|
43
|
+
|
44
|
+
def recursive=(value)
|
45
|
+
@attributes[:recursive] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# string - Owner of the lock. This can be any arbitrary string.
|
40
49
|
def owner
|
41
50
|
@attributes[:owner]
|
42
51
|
end
|
@@ -45,7 +54,7 @@ module Files
|
|
45
54
|
@attributes[:owner] = value
|
46
55
|
end
|
47
56
|
|
48
|
-
# string - Lock scope
|
57
|
+
# string - DEPRECATED: Lock scope
|
49
58
|
def scope
|
50
59
|
@attributes[:scope]
|
51
60
|
end
|
@@ -54,6 +63,15 @@ module Files
|
|
54
63
|
@attributes[:scope] = value
|
55
64
|
end
|
56
65
|
|
66
|
+
# boolean - Is lock exclusive?
|
67
|
+
def exclusive
|
68
|
+
@attributes[:exclusive]
|
69
|
+
end
|
70
|
+
|
71
|
+
def exclusive=(value)
|
72
|
+
@attributes[:exclusive] = value
|
73
|
+
end
|
74
|
+
|
57
75
|
# string - Lock token. Use to release lock.
|
58
76
|
def token
|
59
77
|
@attributes[:token]
|
@@ -63,7 +81,7 @@ module Files
|
|
63
81
|
@attributes[:token] = value
|
64
82
|
end
|
65
83
|
|
66
|
-
# string - Lock type
|
84
|
+
# string - DEPRECATED: Lock type
|
67
85
|
def type
|
68
86
|
@attributes[:type]
|
69
87
|
end
|
@@ -72,6 +90,15 @@ module Files
|
|
72
90
|
@attributes[:type] = value
|
73
91
|
end
|
74
92
|
|
93
|
+
# boolean - Can lock be modified by users other than its creator?
|
94
|
+
def allow_access_by_any_user
|
95
|
+
@attributes[:allow_access_by_any_user]
|
96
|
+
end
|
97
|
+
|
98
|
+
def allow_access_by_any_user=(value)
|
99
|
+
@attributes[:allow_access_by_any_user] = value
|
100
|
+
end
|
101
|
+
|
75
102
|
# int64 - Lock creator user ID
|
76
103
|
def user_id
|
77
104
|
@attributes[:user_id]
|
@@ -133,11 +160,15 @@ module Files
|
|
133
160
|
|
134
161
|
# Parameters:
|
135
162
|
# path (required) - string - Path
|
163
|
+
# allow_access_by_any_user - boolean - Allow lock to be updated by any user?
|
164
|
+
# exclusive - boolean - Is lock exclusive?
|
165
|
+
# recursive - string - Does lock apply to subfolders?
|
136
166
|
# timeout - int64 - Lock timeout length
|
137
167
|
def self.create(path, params = {}, options = {})
|
138
168
|
params ||= {}
|
139
169
|
params[:path] = path
|
140
170
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
171
|
+
raise InvalidParameterError.new("Bad parameter: recursive must be an String") if params.dig(:recursive) and !params.dig(:recursive).is_a?(String)
|
141
172
|
raise InvalidParameterError.new("Bad parameter: timeout must be an Integer") if params.dig(:timeout) and !params.dig(:timeout).is_a?(Integer)
|
142
173
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
143
174
|
|
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.
|
4
|
+
version: 1.0.187
|
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-07-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- docs/file_action.md
|
111
111
|
- docs/file_comment.md
|
112
112
|
- docs/file_comment_reaction.md
|
113
|
+
- docs/file_migration.md
|
113
114
|
- docs/file_upload_part.md
|
114
115
|
- docs/file_utils.md
|
115
116
|
- docs/folder.md
|
@@ -186,6 +187,7 @@ files:
|
|
186
187
|
- lib/files.com/models/file_action.rb
|
187
188
|
- lib/files.com/models/file_comment.rb
|
188
189
|
- lib/files.com/models/file_comment_reaction.rb
|
190
|
+
- lib/files.com/models/file_migration.rb
|
189
191
|
- lib/files.com/models/file_upload_part.rb
|
190
192
|
- lib/files.com/models/file_utils.rb
|
191
193
|
- lib/files.com/models/folder.rb
|