files.com 1.1.238 → 1.1.239
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/restore.md +74 -0
- data/lib/files.com/models/restore.rb +179 -0
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +1 -0
- 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: 48b8f69e129f0389268f653134ab32d345a8ae7e7fd4be67a0e85edfbba71741
|
4
|
+
data.tar.gz: 518fb6dc6a7e747c65e3bd5a873df8a2cc0b5ad84009b6759f79e6e473f790db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d0799e9f4a800bf86253482e55a48fd415afaf6b19cd9f7e152db32365fccf5ea2f035a1f44d4fc27faa593813114f211c8875f524bc98d162614adf92146b6
|
7
|
+
data.tar.gz: 9a0470c243e9717aebd655a72e563ac6cd0d096caeed43e5ced6e1a7c8fcf60285cca60e8fa4dabe97efcb0f9978a3082eedc348448dfa34d688f13bef0ab6dd
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.239
|
data/docs/restore.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Restore
|
2
|
+
|
3
|
+
## Example Restore Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"earliest_date": "2000-01-01T01:00:00Z",
|
8
|
+
"id": 1,
|
9
|
+
"dirs_restored": 1,
|
10
|
+
"dirs_errored": 1,
|
11
|
+
"dirs_total": 1,
|
12
|
+
"files_restored": 1,
|
13
|
+
"files_errored": 1,
|
14
|
+
"files_total": 1,
|
15
|
+
"prefix": "foo/bar/baz.txt",
|
16
|
+
"restore_in_place": true,
|
17
|
+
"restore_deleted_permissions": true,
|
18
|
+
"status": "pending",
|
19
|
+
"update_timestamps": true,
|
20
|
+
"error_messages": [
|
21
|
+
"example"
|
22
|
+
]
|
23
|
+
}
|
24
|
+
```
|
25
|
+
|
26
|
+
* `earliest_date` (date-time): Restore all files deleted after this date/time. Don't set this earlier than you need. Can not be greater than 365
|
27
|
+
* `id` (int64): Restore Record ID.
|
28
|
+
* `dirs_restored` (int64): Number of directories that were successfully restored.
|
29
|
+
* `dirs_errored` (int64): Number of directories that were not able to be restored.
|
30
|
+
* `dirs_total` (int64): Total number of directories processed.
|
31
|
+
* `files_restored` (int64): Number of files successfully restored.
|
32
|
+
* `files_errored` (int64): Number of files that were not able to be restored.
|
33
|
+
* `files_total` (int64): Total number of files processed.
|
34
|
+
* `prefix` (string): Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash.
|
35
|
+
* `restore_in_place` (boolean): If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
36
|
+
* `restore_deleted_permissions` (boolean): If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
37
|
+
* `status` (string): Status of the restoration process.
|
38
|
+
* `update_timestamps` (boolean): If trie, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
|
39
|
+
* `error_messages` (array(string)): Error messages received while restoring files and/or directories. Only present if there were errors.
|
40
|
+
|
41
|
+
|
42
|
+
---
|
43
|
+
|
44
|
+
## List Restores
|
45
|
+
|
46
|
+
```
|
47
|
+
Files::Restore.list
|
48
|
+
```
|
49
|
+
|
50
|
+
### Parameters
|
51
|
+
|
52
|
+
* `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.
|
53
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
54
|
+
|
55
|
+
|
56
|
+
---
|
57
|
+
|
58
|
+
## Create Restore
|
59
|
+
|
60
|
+
```
|
61
|
+
Files::Restore.create(
|
62
|
+
earliest_date: "2000-01-01T01:00:00Z",
|
63
|
+
restore_deleted_permissions: true,
|
64
|
+
restore_in_place: true,
|
65
|
+
prefix: "foo/bar/baz.txt"
|
66
|
+
)
|
67
|
+
```
|
68
|
+
|
69
|
+
### Parameters
|
70
|
+
|
71
|
+
* `earliest_date` (string): Required - Restore all files deleted after this date/time. Don't set this earlier than you need. Can not be greater than 365
|
72
|
+
* `restore_deleted_permissions` (boolean): If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
73
|
+
* `restore_in_place` (boolean): If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
74
|
+
* `prefix` (string): Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash.
|
@@ -0,0 +1,179 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class Restore
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# date-time - Restore all files deleted after this date/time. Don't set this earlier than you need. Can not be greater than 365
|
13
|
+
def earliest_date
|
14
|
+
@attributes[:earliest_date]
|
15
|
+
end
|
16
|
+
|
17
|
+
def earliest_date=(value)
|
18
|
+
@attributes[:earliest_date] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# int64 - Restore Record ID.
|
22
|
+
def id
|
23
|
+
@attributes[:id]
|
24
|
+
end
|
25
|
+
|
26
|
+
def id=(value)
|
27
|
+
@attributes[:id] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# int64 - Number of directories that were successfully restored.
|
31
|
+
def dirs_restored
|
32
|
+
@attributes[:dirs_restored]
|
33
|
+
end
|
34
|
+
|
35
|
+
def dirs_restored=(value)
|
36
|
+
@attributes[:dirs_restored] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# int64 - Number of directories that were not able to be restored.
|
40
|
+
def dirs_errored
|
41
|
+
@attributes[:dirs_errored]
|
42
|
+
end
|
43
|
+
|
44
|
+
def dirs_errored=(value)
|
45
|
+
@attributes[:dirs_errored] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# int64 - Total number of directories processed.
|
49
|
+
def dirs_total
|
50
|
+
@attributes[:dirs_total]
|
51
|
+
end
|
52
|
+
|
53
|
+
def dirs_total=(value)
|
54
|
+
@attributes[:dirs_total] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# int64 - Number of files successfully restored.
|
58
|
+
def files_restored
|
59
|
+
@attributes[:files_restored]
|
60
|
+
end
|
61
|
+
|
62
|
+
def files_restored=(value)
|
63
|
+
@attributes[:files_restored] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# int64 - Number of files that were not able to be restored.
|
67
|
+
def files_errored
|
68
|
+
@attributes[:files_errored]
|
69
|
+
end
|
70
|
+
|
71
|
+
def files_errored=(value)
|
72
|
+
@attributes[:files_errored] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# int64 - Total number of files processed.
|
76
|
+
def files_total
|
77
|
+
@attributes[:files_total]
|
78
|
+
end
|
79
|
+
|
80
|
+
def files_total=(value)
|
81
|
+
@attributes[:files_total] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
# string - Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash.
|
85
|
+
def prefix
|
86
|
+
@attributes[:prefix]
|
87
|
+
end
|
88
|
+
|
89
|
+
def prefix=(value)
|
90
|
+
@attributes[:prefix] = value
|
91
|
+
end
|
92
|
+
|
93
|
+
# boolean - If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
94
|
+
def restore_in_place
|
95
|
+
@attributes[:restore_in_place]
|
96
|
+
end
|
97
|
+
|
98
|
+
def restore_in_place=(value)
|
99
|
+
@attributes[:restore_in_place] = value
|
100
|
+
end
|
101
|
+
|
102
|
+
# boolean - If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
103
|
+
def restore_deleted_permissions
|
104
|
+
@attributes[:restore_deleted_permissions]
|
105
|
+
end
|
106
|
+
|
107
|
+
def restore_deleted_permissions=(value)
|
108
|
+
@attributes[:restore_deleted_permissions] = value
|
109
|
+
end
|
110
|
+
|
111
|
+
# string - Status of the restoration process.
|
112
|
+
def status
|
113
|
+
@attributes[:status]
|
114
|
+
end
|
115
|
+
|
116
|
+
def status=(value)
|
117
|
+
@attributes[:status] = value
|
118
|
+
end
|
119
|
+
|
120
|
+
# boolean - If trie, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.
|
121
|
+
def update_timestamps
|
122
|
+
@attributes[:update_timestamps]
|
123
|
+
end
|
124
|
+
|
125
|
+
def update_timestamps=(value)
|
126
|
+
@attributes[:update_timestamps] = value
|
127
|
+
end
|
128
|
+
|
129
|
+
# array(string) - Error messages received while restoring files and/or directories. Only present if there were errors.
|
130
|
+
def error_messages
|
131
|
+
@attributes[:error_messages]
|
132
|
+
end
|
133
|
+
|
134
|
+
def error_messages=(value)
|
135
|
+
@attributes[:error_messages] = value
|
136
|
+
end
|
137
|
+
|
138
|
+
def save
|
139
|
+
if @attributes[:id]
|
140
|
+
raise NotImplementedError.new("The Restore object doesn't support updates.")
|
141
|
+
else
|
142
|
+
new_obj = Restore.create(@attributes, @options)
|
143
|
+
end
|
144
|
+
|
145
|
+
@attributes = new_obj.attributes
|
146
|
+
true
|
147
|
+
end
|
148
|
+
|
149
|
+
# Parameters:
|
150
|
+
# 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.
|
151
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
152
|
+
def self.list(params = {}, options = {})
|
153
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
154
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
155
|
+
|
156
|
+
List.new(Restore, params) do
|
157
|
+
Api.send_request("/restores", :get, params, options)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def self.all(params = {}, options = {})
|
162
|
+
list(params, options)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Parameters:
|
166
|
+
# earliest_date (required) - string - Restore all files deleted after this date/time. Don't set this earlier than you need. Can not be greater than 365
|
167
|
+
# restore_deleted_permissions - boolean - If true, we will also restore any Permissions that match the same path prefix from the same dates.
|
168
|
+
# restore_in_place - boolean - If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.
|
169
|
+
# prefix - string - Prefix of the files/folders to restore. To restore a folder, add a trailing slash to the folder name. Do not use a leading slash.
|
170
|
+
def self.create(params = {}, options = {})
|
171
|
+
raise InvalidParameterError.new("Bad parameter: earliest_date must be an String") if params[:earliest_date] and !params[:earliest_date].is_a?(String)
|
172
|
+
raise InvalidParameterError.new("Bad parameter: prefix must be an String") if params[:prefix] and !params[:prefix].is_a?(String)
|
173
|
+
raise MissingParameterError.new("Parameter missing: earliest_date") unless params[:earliest_date]
|
174
|
+
|
175
|
+
response, options = Api.send_request("/restores", :post, params, options)
|
176
|
+
Restore.new(response.data, options)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
data/lib/files.com/version.rb
CHANGED
data/lib/files.com.rb
CHANGED
@@ -107,6 +107,7 @@ require "files.com/models/remote_bandwidth_snapshot"
|
|
107
107
|
require "files.com/models/remote_server"
|
108
108
|
require "files.com/models/remote_server_configuration_file"
|
109
109
|
require "files.com/models/request"
|
110
|
+
require "files.com/models/restore"
|
110
111
|
require "files.com/models/session"
|
111
112
|
require "files.com/models/settings_change"
|
112
113
|
require "files.com/models/sftp_action_log"
|
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.239
|
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-04-
|
11
|
+
date: 2025-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- docs/remote_server.md
|
191
191
|
- docs/remote_server_configuration_file.md
|
192
192
|
- docs/request.md
|
193
|
+
- docs/restore.md
|
193
194
|
- docs/session.md
|
194
195
|
- docs/settings_change.md
|
195
196
|
- docs/sftp_action_log.md
|
@@ -295,6 +296,7 @@ files:
|
|
295
296
|
- lib/files.com/models/remote_server.rb
|
296
297
|
- lib/files.com/models/remote_server_configuration_file.rb
|
297
298
|
- lib/files.com/models/request.rb
|
299
|
+
- lib/files.com/models/restore.rb
|
298
300
|
- lib/files.com/models/session.rb
|
299
301
|
- lib/files.com/models/settings_change.rb
|
300
302
|
- lib/files.com/models/sftp_action_log.rb
|