files.com 1.0.41 → 1.0.42
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/api_key.md +55 -3
- data/docs/remote_server.md +52 -4
- data/docs/request.md +43 -0
- data/lib/files.com/models/api_key.rb +46 -6
- data/lib/files.com/models/remote_server.rb +120 -0
- data/lib/files.com/models/request.rb +37 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10dc1016d21d7320dcc3d84d15dfec29a3da54d82a0baeaa953e2b3ef8ca10aa
|
4
|
+
data.tar.gz: eb7264487bfd2b001cab69d03b692496eddd6f0d8f4196f4e128192a3db211df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baaad039f6e58730857ac2f25494cf3a17206493eb888fb9808647af31924903cae55c7eae9919ab079d486396ab4e795bcb9822b7bfc0ac1c0417c7ac192df1
|
7
|
+
data.tar.gz: 3d141b7fadb56aebe7e053bd6379d060665a7ae1987280962b5f5734612cd07c52e6428f4cb79f72e348f1016cfc0918a90e71bb9f90f49404d6a3082b5f6c13
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.42
|
data/docs/api_key.md
CHANGED
@@ -54,7 +54,7 @@ Files::ApiKey.list(
|
|
54
54
|
## Show information about current API key. (Requires current API connection to be using an API key.)
|
55
55
|
|
56
56
|
```
|
57
|
-
Files::ApiKey.
|
57
|
+
Files::ApiKey.find_current
|
58
58
|
```
|
59
59
|
|
60
60
|
|
@@ -97,7 +97,7 @@ Files::ApiKey.create(
|
|
97
97
|
## Update current API key. (Requires current API connection to be using an API key.)
|
98
98
|
|
99
99
|
```
|
100
|
-
Files::ApiKey.
|
100
|
+
Files::ApiKey.update_current(
|
101
101
|
name: "My Key",
|
102
102
|
permission_set: "full",
|
103
103
|
expires_at: "2000-01-01T01:00:00Z"
|
@@ -111,15 +111,67 @@ Files::ApiKey.update(
|
|
111
111
|
* `expires_at` (string): Have the key expire at this date/time.
|
112
112
|
|
113
113
|
|
114
|
+
---
|
115
|
+
|
116
|
+
## Update current API key. (Requires current API connection to be using an API key.)
|
117
|
+
|
118
|
+
```
|
119
|
+
Files::ApiKey.update_current(
|
120
|
+
name: "My Key",
|
121
|
+
permission_set: "full",
|
122
|
+
expires_at: "2000-01-01T01:00:00Z"
|
123
|
+
)
|
124
|
+
```
|
125
|
+
|
126
|
+
### Parameters
|
127
|
+
|
128
|
+
* `name` (string): Internal name for key. For your reference only.
|
129
|
+
* `permission_set` (string): Leave blank, or set to `desktop_app` to restrict the key to only desktop app functions.
|
130
|
+
* `expires_at` (string): Have the key expire at this date/time.
|
131
|
+
|
132
|
+
|
133
|
+
---
|
134
|
+
|
135
|
+
## Update Api Key
|
136
|
+
|
137
|
+
```
|
138
|
+
Files::ApiKey.update(id,
|
139
|
+
name: "My Key",
|
140
|
+
permission_set: "full",
|
141
|
+
expires_at: "2000-01-01T01:00:00Z"
|
142
|
+
)
|
143
|
+
```
|
144
|
+
|
145
|
+
### Parameters
|
146
|
+
|
147
|
+
* `id` (int64): Required - Api Key ID.
|
148
|
+
* `name` (string): Internal name for key. For your reference only.
|
149
|
+
* `permission_set` (string): Leave blank, or set to 'desktop_app' to restrict the key to only desktop app functions.
|
150
|
+
* `expires_at` (string): Have the key expire at this date/time.
|
151
|
+
|
152
|
+
|
114
153
|
---
|
115
154
|
|
116
155
|
## Delete current API key. (Requires current API connection to be using an API key.)
|
117
156
|
|
118
157
|
```
|
119
|
-
Files::ApiKey.
|
158
|
+
Files::ApiKey.delete_current
|
120
159
|
```
|
121
160
|
|
122
161
|
|
162
|
+
---
|
163
|
+
|
164
|
+
## Delete Api Key
|
165
|
+
|
166
|
+
```
|
167
|
+
Files::ApiKey.delete(id)
|
168
|
+
```
|
169
|
+
|
170
|
+
### Parameters
|
171
|
+
|
172
|
+
* `id` (int64): Required - Api Key ID.
|
173
|
+
|
174
|
+
|
123
175
|
---
|
124
176
|
|
125
177
|
## Update Api Key
|
data/docs/remote_server.md
CHANGED
@@ -17,7 +17,11 @@
|
|
17
17
|
"ssl": "always",
|
18
18
|
"username": "user",
|
19
19
|
"google_cloud_storage_bucket": "my-bucket",
|
20
|
-
"google_cloud_storage_project_id": "my-project"
|
20
|
+
"google_cloud_storage_project_id": "my-project",
|
21
|
+
"b2_region": "us-west-001",
|
22
|
+
"b2_bucket": "my-bucket",
|
23
|
+
"wasabi_bucket": "us-west-1",
|
24
|
+
"wasabi_region": "my-bucket"
|
21
25
|
}
|
22
26
|
```
|
23
27
|
|
@@ -35,11 +39,19 @@
|
|
35
39
|
* `username` (string): Remote server username. Not needed for S3 buckets.
|
36
40
|
* `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
|
37
41
|
* `google_cloud_storage_project_id` (string): Google Cloud Project ID
|
42
|
+
* `b2_region` (string): b2 region
|
43
|
+
* `b2_bucket` (string): b2 Bucket name
|
44
|
+
* `wasabi_bucket` (string): Wasabi region
|
45
|
+
* `wasabi_region` (string): Wasabi Bucket name
|
38
46
|
* `aws_access_key` (string): AWS Access Key.
|
39
47
|
* `aws_secret_key` (string): AWS secret key.
|
40
48
|
* `password` (string): Password if needed.
|
41
49
|
* `private_key` (string): Private key if needed.
|
42
50
|
* `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
51
|
+
* `wasabi_access_key` (string): Wasabi access key.
|
52
|
+
* `wasabi_secret_key` (string): Wasabi secret key.
|
53
|
+
* `b2_access_key` (string): Backblaze B2 Cloud Storage access key.
|
54
|
+
* `b2_secret_key` (string): Backblaze B2 Cloud Storage secret key.
|
43
55
|
|
44
56
|
|
45
57
|
---
|
@@ -90,7 +102,11 @@ Files::RemoteServer.create(
|
|
90
102
|
ssl: "always",
|
91
103
|
username: "user",
|
92
104
|
google_cloud_storage_bucket: "my-bucket",
|
93
|
-
google_cloud_storage_project_id: "my-project"
|
105
|
+
google_cloud_storage_project_id: "my-project",
|
106
|
+
b2_bucket: "my-bucket",
|
107
|
+
b2_region: "us-west-001",
|
108
|
+
wasabi_bucket: "us-west-1",
|
109
|
+
wasabi_region: "my-bucket"
|
94
110
|
)
|
95
111
|
```
|
96
112
|
|
@@ -101,6 +117,10 @@ Files::RemoteServer.create(
|
|
101
117
|
* `password` (string): Password if needed.
|
102
118
|
* `private_key` (string): Private key if needed.
|
103
119
|
* `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
120
|
+
* `wasabi_access_key` (string): Wasabi access key.
|
121
|
+
* `wasabi_secret_key` (string): Wasabi secret key.
|
122
|
+
* `b2_access_key` (string): Backblaze B2 Cloud Storage access key.
|
123
|
+
* `b2_secret_key` (string): Backblaze B2 Cloud Storage secret key.
|
104
124
|
* `hostname` (string): Hostname or IP address
|
105
125
|
* `name` (string): Internal name for your reference
|
106
126
|
* `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -113,6 +133,10 @@ Files::RemoteServer.create(
|
|
113
133
|
* `username` (string): Remote server username. Not needed for S3 buckets.
|
114
134
|
* `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
|
115
135
|
* `google_cloud_storage_project_id` (string): Google Cloud Project ID
|
136
|
+
* `b2_bucket` (string): b2 Bucket name
|
137
|
+
* `b2_region` (string): b2 region
|
138
|
+
* `wasabi_bucket` (string): Wasabi region
|
139
|
+
* `wasabi_region` (string): Wasabi Bucket name
|
116
140
|
|
117
141
|
|
118
142
|
---
|
@@ -132,7 +156,11 @@ Files::RemoteServer.update(id,
|
|
132
156
|
ssl: "always",
|
133
157
|
username: "user",
|
134
158
|
google_cloud_storage_bucket: "my-bucket",
|
135
|
-
google_cloud_storage_project_id: "my-project"
|
159
|
+
google_cloud_storage_project_id: "my-project",
|
160
|
+
b2_bucket: "my-bucket",
|
161
|
+
b2_region: "us-west-001",
|
162
|
+
wasabi_bucket: "us-west-1",
|
163
|
+
wasabi_region: "my-bucket"
|
136
164
|
)
|
137
165
|
```
|
138
166
|
|
@@ -144,6 +172,10 @@ Files::RemoteServer.update(id,
|
|
144
172
|
* `password` (string): Password if needed.
|
145
173
|
* `private_key` (string): Private key if needed.
|
146
174
|
* `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
175
|
+
* `wasabi_access_key` (string): Wasabi access key.
|
176
|
+
* `wasabi_secret_key` (string): Wasabi secret key.
|
177
|
+
* `b2_access_key` (string): Backblaze B2 Cloud Storage access key.
|
178
|
+
* `b2_secret_key` (string): Backblaze B2 Cloud Storage secret key.
|
147
179
|
* `hostname` (string): Hostname or IP address
|
148
180
|
* `name` (string): Internal name for your reference
|
149
181
|
* `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -156,6 +188,10 @@ Files::RemoteServer.update(id,
|
|
156
188
|
* `username` (string): Remote server username. Not needed for S3 buckets.
|
157
189
|
* `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
|
158
190
|
* `google_cloud_storage_project_id` (string): Google Cloud Project ID
|
191
|
+
* `b2_bucket` (string): b2 Bucket name
|
192
|
+
* `b2_region` (string): b2 region
|
193
|
+
* `wasabi_bucket` (string): Wasabi region
|
194
|
+
* `wasabi_region` (string): Wasabi Bucket name
|
159
195
|
|
160
196
|
|
161
197
|
---
|
@@ -189,7 +225,11 @@ remote_server.update(
|
|
189
225
|
ssl: "always",
|
190
226
|
username: "user",
|
191
227
|
google_cloud_storage_bucket: "my-bucket",
|
192
|
-
google_cloud_storage_project_id: "my-project"
|
228
|
+
google_cloud_storage_project_id: "my-project",
|
229
|
+
b2_bucket: "my-bucket",
|
230
|
+
b2_region: "us-west-001",
|
231
|
+
wasabi_bucket: "us-west-1",
|
232
|
+
wasabi_region: "my-bucket"
|
193
233
|
)
|
194
234
|
```
|
195
235
|
|
@@ -201,6 +241,10 @@ remote_server.update(
|
|
201
241
|
* `password` (string): Password if needed.
|
202
242
|
* `private_key` (string): Private key if needed.
|
203
243
|
* `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
244
|
+
* `wasabi_access_key` (string): Wasabi access key.
|
245
|
+
* `wasabi_secret_key` (string): Wasabi secret key.
|
246
|
+
* `b2_access_key` (string): Backblaze B2 Cloud Storage access key.
|
247
|
+
* `b2_secret_key` (string): Backblaze B2 Cloud Storage secret key.
|
204
248
|
* `hostname` (string): Hostname or IP address
|
205
249
|
* `name` (string): Internal name for your reference
|
206
250
|
* `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -213,6 +257,10 @@ remote_server.update(
|
|
213
257
|
* `username` (string): Remote server username. Not needed for S3 buckets.
|
214
258
|
* `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
|
215
259
|
* `google_cloud_storage_project_id` (string): Google Cloud Project ID
|
260
|
+
* `b2_bucket` (string): b2 Bucket name
|
261
|
+
* `b2_region` (string): b2 region
|
262
|
+
* `wasabi_bucket` (string): Wasabi region
|
263
|
+
* `wasabi_region` (string): Wasabi Bucket name
|
216
264
|
|
217
265
|
|
218
266
|
---
|
data/docs/request.md
CHANGED
@@ -44,6 +44,27 @@ Files::Request.list(path,
|
|
44
44
|
* `path` (string): Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
|
45
45
|
|
46
46
|
|
47
|
+
---
|
48
|
+
|
49
|
+
## List Requests
|
50
|
+
|
51
|
+
```
|
52
|
+
Files::Request.folders(path,
|
53
|
+
page: 1,
|
54
|
+
per_page: 1,
|
55
|
+
mine: true
|
56
|
+
)
|
57
|
+
```
|
58
|
+
|
59
|
+
### Parameters
|
60
|
+
|
61
|
+
* `page` (int64): Current page number.
|
62
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
63
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
64
|
+
* `mine` (boolean): Only show requests of the current user? (Defaults to true if current user is not a site admin.)
|
65
|
+
* `path` (string): Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
|
66
|
+
|
67
|
+
|
47
68
|
---
|
48
69
|
|
49
70
|
## Create Request
|
@@ -75,6 +96,28 @@ Files::Request.delete(id)
|
|
75
96
|
* `id` (int64): Required - Request ID.
|
76
97
|
|
77
98
|
|
99
|
+
---
|
100
|
+
|
101
|
+
## List Requests
|
102
|
+
|
103
|
+
```
|
104
|
+
request = Files::Request.find(1)
|
105
|
+
request.folders(
|
106
|
+
page: 1,
|
107
|
+
per_page: 1,
|
108
|
+
mine: true
|
109
|
+
)
|
110
|
+
```
|
111
|
+
|
112
|
+
### Parameters
|
113
|
+
|
114
|
+
* `page` (int64): Current page number.
|
115
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
116
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
117
|
+
* `mine` (boolean): Only show requests of the current user? (Defaults to true if current user is not a site admin.)
|
118
|
+
* `path` (string): Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
|
119
|
+
|
120
|
+
|
78
121
|
---
|
79
122
|
|
80
123
|
## Create Request
|
@@ -153,7 +153,7 @@ module Files
|
|
153
153
|
list(params, options)
|
154
154
|
end
|
155
155
|
|
156
|
-
def self.
|
156
|
+
def self.find_current(params = {}, options = {})
|
157
157
|
response, options = Api.send_request("/api_key", :get, params, options)
|
158
158
|
ApiKey.new(response.data, options)
|
159
159
|
end
|
@@ -193,22 +193,62 @@ module Files
|
|
193
193
|
# name - string - Internal name for key. For your reference only.
|
194
194
|
# permission_set - string - Leave blank, or set to `desktop_app` to restrict the key to only desktop app functions.
|
195
195
|
# expires_at - string - Have the key expire at this date/time.
|
196
|
-
def self.
|
196
|
+
def self.update_current(params = {}, options = {})
|
197
197
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
198
198
|
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
199
199
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
200
200
|
|
201
|
-
response, options = Api.send_request("/api_key", :
|
201
|
+
response, options = Api.send_request("/api_key", :put, params, options)
|
202
202
|
ApiKey.new(response.data, options)
|
203
203
|
end
|
204
204
|
|
205
|
-
|
205
|
+
# Parameters:
|
206
|
+
# name - string - Internal name for key. For your reference only.
|
207
|
+
# permission_set - string - Leave blank, or set to `desktop_app` to restrict the key to only desktop app functions.
|
208
|
+
# expires_at - string - Have the key expire at this date/time.
|
209
|
+
def self.update_current(params = {}, options = {})
|
210
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
211
|
+
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
212
|
+
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
213
|
+
|
214
|
+
response, options = Api.send_request("/api_key", :put, params, options)
|
215
|
+
ApiKey.new(response.data, options)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Parameters:
|
219
|
+
# name - string - Internal name for key. For your reference only.
|
220
|
+
# permission_set - string - Leave blank, or set to 'desktop_app' to restrict the key to only desktop app functions.
|
221
|
+
# expires_at - string - Have the key expire at this date/time.
|
222
|
+
def self.update(id, params = {}, options = {})
|
223
|
+
params ||= {}
|
224
|
+
params[:id] = id
|
225
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
226
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
227
|
+
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
228
|
+
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
229
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
230
|
+
|
231
|
+
response, options = Api.send_request("/api_keys/#{params[:id]}", :patch, params, options)
|
232
|
+
ApiKey.new(response.data, options)
|
233
|
+
end
|
234
|
+
|
235
|
+
def self.delete_current(params = {}, options = {})
|
206
236
|
response, _options = Api.send_request("/api_key", :delete, params, options)
|
207
237
|
response.data
|
208
238
|
end
|
209
239
|
|
210
|
-
def self.
|
211
|
-
|
240
|
+
def self.delete(id, params = {}, options = {})
|
241
|
+
params ||= {}
|
242
|
+
params[:id] = id
|
243
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
244
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
245
|
+
|
246
|
+
response, _options = Api.send_request("/api_keys/#{params[:id]}", :delete, params, options)
|
247
|
+
response.data
|
248
|
+
end
|
249
|
+
|
250
|
+
def self.destroy(id, params = {}, options = {})
|
251
|
+
delete(id, params, options)
|
212
252
|
end
|
213
253
|
end
|
214
254
|
end
|
@@ -135,6 +135,42 @@ module Files
|
|
135
135
|
@attributes[:google_cloud_storage_project_id] = value
|
136
136
|
end
|
137
137
|
|
138
|
+
# string - b2 region
|
139
|
+
def b2_region
|
140
|
+
@attributes[:b2_region]
|
141
|
+
end
|
142
|
+
|
143
|
+
def b2_region=(value)
|
144
|
+
@attributes[:b2_region] = value
|
145
|
+
end
|
146
|
+
|
147
|
+
# string - b2 Bucket name
|
148
|
+
def b2_bucket
|
149
|
+
@attributes[:b2_bucket]
|
150
|
+
end
|
151
|
+
|
152
|
+
def b2_bucket=(value)
|
153
|
+
@attributes[:b2_bucket] = value
|
154
|
+
end
|
155
|
+
|
156
|
+
# string - Wasabi region
|
157
|
+
def wasabi_bucket
|
158
|
+
@attributes[:wasabi_bucket]
|
159
|
+
end
|
160
|
+
|
161
|
+
def wasabi_bucket=(value)
|
162
|
+
@attributes[:wasabi_bucket] = value
|
163
|
+
end
|
164
|
+
|
165
|
+
# string - Wasabi Bucket name
|
166
|
+
def wasabi_region
|
167
|
+
@attributes[:wasabi_region]
|
168
|
+
end
|
169
|
+
|
170
|
+
def wasabi_region=(value)
|
171
|
+
@attributes[:wasabi_region] = value
|
172
|
+
end
|
173
|
+
|
138
174
|
# string - AWS Access Key.
|
139
175
|
def aws_access_key
|
140
176
|
@attributes[:aws_access_key]
|
@@ -180,12 +216,52 @@ module Files
|
|
180
216
|
@attributes[:google_cloud_storage_credentials_json] = value
|
181
217
|
end
|
182
218
|
|
219
|
+
# string - Wasabi access key.
|
220
|
+
def wasabi_access_key
|
221
|
+
@attributes[:wasabi_access_key]
|
222
|
+
end
|
223
|
+
|
224
|
+
def wasabi_access_key=(value)
|
225
|
+
@attributes[:wasabi_access_key] = value
|
226
|
+
end
|
227
|
+
|
228
|
+
# string - Wasabi secret key.
|
229
|
+
def wasabi_secret_key
|
230
|
+
@attributes[:wasabi_secret_key]
|
231
|
+
end
|
232
|
+
|
233
|
+
def wasabi_secret_key=(value)
|
234
|
+
@attributes[:wasabi_secret_key] = value
|
235
|
+
end
|
236
|
+
|
237
|
+
# string - Backblaze B2 Cloud Storage access key.
|
238
|
+
def b2_access_key
|
239
|
+
@attributes[:b2_access_key]
|
240
|
+
end
|
241
|
+
|
242
|
+
def b2_access_key=(value)
|
243
|
+
@attributes[:b2_access_key] = value
|
244
|
+
end
|
245
|
+
|
246
|
+
# string - Backblaze B2 Cloud Storage secret key.
|
247
|
+
def b2_secret_key
|
248
|
+
@attributes[:b2_secret_key]
|
249
|
+
end
|
250
|
+
|
251
|
+
def b2_secret_key=(value)
|
252
|
+
@attributes[:b2_secret_key] = value
|
253
|
+
end
|
254
|
+
|
183
255
|
# Parameters:
|
184
256
|
# aws_access_key - string - AWS Access Key.
|
185
257
|
# aws_secret_key - string - AWS secret key.
|
186
258
|
# password - string - Password if needed.
|
187
259
|
# private_key - string - Private key if needed.
|
188
260
|
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
261
|
+
# wasabi_access_key - string - Wasabi access key.
|
262
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
263
|
+
# b2_access_key - string - Backblaze B2 Cloud Storage access key.
|
264
|
+
# b2_secret_key - string - Backblaze B2 Cloud Storage secret key.
|
189
265
|
# hostname - string - Hostname or IP address
|
190
266
|
# name - string - Internal name for your reference
|
191
267
|
# max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -198,6 +274,10 @@ module Files
|
|
198
274
|
# username - string - Remote server username. Not needed for S3 buckets.
|
199
275
|
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
200
276
|
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
277
|
+
# b2_bucket - string - b2 Bucket name
|
278
|
+
# b2_region - string - b2 region
|
279
|
+
# wasabi_bucket - string - Wasabi region
|
280
|
+
# wasabi_region - string - Wasabi Bucket name
|
201
281
|
def update(params = {})
|
202
282
|
params ||= {}
|
203
283
|
params[:id] = @attributes[:id]
|
@@ -208,6 +288,10 @@ module Files
|
|
208
288
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
209
289
|
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params.dig(:private_key) and !params.dig(:private_key).is_a?(String)
|
210
290
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
|
291
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params.dig(:wasabi_access_key) and !params.dig(:wasabi_access_key).is_a?(String)
|
292
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
|
293
|
+
raise InvalidParameterError.new("Bad parameter: b2_access_key must be an String") if params.dig(:b2_access_key) and !params.dig(:b2_access_key).is_a?(String)
|
294
|
+
raise InvalidParameterError.new("Bad parameter: b2_secret_key must be an String") if params.dig(:b2_secret_key) and !params.dig(:b2_secret_key).is_a?(String)
|
211
295
|
raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
|
212
296
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
213
297
|
raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
|
@@ -220,6 +304,10 @@ module Files
|
|
220
304
|
raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
|
221
305
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
|
222
306
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
|
307
|
+
raise InvalidParameterError.new("Bad parameter: b2_bucket must be an String") if params.dig(:b2_bucket) and !params.dig(:b2_bucket).is_a?(String)
|
308
|
+
raise InvalidParameterError.new("Bad parameter: b2_region must be an String") if params.dig(:b2_region) and !params.dig(:b2_region).is_a?(String)
|
309
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
|
310
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
|
223
311
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
224
312
|
|
225
313
|
Api.send_request("/remote_servers/#{@attributes[:id]}", :patch, params, @options)
|
@@ -286,6 +374,10 @@ module Files
|
|
286
374
|
# password - string - Password if needed.
|
287
375
|
# private_key - string - Private key if needed.
|
288
376
|
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
377
|
+
# wasabi_access_key - string - Wasabi access key.
|
378
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
379
|
+
# b2_access_key - string - Backblaze B2 Cloud Storage access key.
|
380
|
+
# b2_secret_key - string - Backblaze B2 Cloud Storage secret key.
|
289
381
|
# hostname - string - Hostname or IP address
|
290
382
|
# name - string - Internal name for your reference
|
291
383
|
# max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -298,12 +390,20 @@ module Files
|
|
298
390
|
# username - string - Remote server username. Not needed for S3 buckets.
|
299
391
|
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
300
392
|
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
393
|
+
# b2_bucket - string - b2 Bucket name
|
394
|
+
# b2_region - string - b2 region
|
395
|
+
# wasabi_bucket - string - Wasabi region
|
396
|
+
# wasabi_region - string - Wasabi Bucket name
|
301
397
|
def self.create(params = {}, options = {})
|
302
398
|
raise InvalidParameterError.new("Bad parameter: aws_access_key must be an String") if params.dig(:aws_access_key) and !params.dig(:aws_access_key).is_a?(String)
|
303
399
|
raise InvalidParameterError.new("Bad parameter: aws_secret_key must be an String") if params.dig(:aws_secret_key) and !params.dig(:aws_secret_key).is_a?(String)
|
304
400
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
305
401
|
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params.dig(:private_key) and !params.dig(:private_key).is_a?(String)
|
306
402
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
|
403
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params.dig(:wasabi_access_key) and !params.dig(:wasabi_access_key).is_a?(String)
|
404
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
|
405
|
+
raise InvalidParameterError.new("Bad parameter: b2_access_key must be an String") if params.dig(:b2_access_key) and !params.dig(:b2_access_key).is_a?(String)
|
406
|
+
raise InvalidParameterError.new("Bad parameter: b2_secret_key must be an String") if params.dig(:b2_secret_key) and !params.dig(:b2_secret_key).is_a?(String)
|
307
407
|
raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
|
308
408
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
309
409
|
raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
|
@@ -316,6 +416,10 @@ module Files
|
|
316
416
|
raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
|
317
417
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
|
318
418
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
|
419
|
+
raise InvalidParameterError.new("Bad parameter: b2_bucket must be an String") if params.dig(:b2_bucket) and !params.dig(:b2_bucket).is_a?(String)
|
420
|
+
raise InvalidParameterError.new("Bad parameter: b2_region must be an String") if params.dig(:b2_region) and !params.dig(:b2_region).is_a?(String)
|
421
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
|
422
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
|
319
423
|
|
320
424
|
response, options = Api.send_request("/remote_servers", :post, params, options)
|
321
425
|
RemoteServer.new(response.data, options)
|
@@ -327,6 +431,10 @@ module Files
|
|
327
431
|
# password - string - Password if needed.
|
328
432
|
# private_key - string - Private key if needed.
|
329
433
|
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
434
|
+
# wasabi_access_key - string - Wasabi access key.
|
435
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
436
|
+
# b2_access_key - string - Backblaze B2 Cloud Storage access key.
|
437
|
+
# b2_secret_key - string - Backblaze B2 Cloud Storage secret key.
|
330
438
|
# hostname - string - Hostname or IP address
|
331
439
|
# name - string - Internal name for your reference
|
332
440
|
# max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
@@ -339,6 +447,10 @@ module Files
|
|
339
447
|
# username - string - Remote server username. Not needed for S3 buckets.
|
340
448
|
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
341
449
|
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
450
|
+
# b2_bucket - string - b2 Bucket name
|
451
|
+
# b2_region - string - b2 region
|
452
|
+
# wasabi_bucket - string - Wasabi region
|
453
|
+
# wasabi_region - string - Wasabi Bucket name
|
342
454
|
def self.update(id, params = {}, options = {})
|
343
455
|
params ||= {}
|
344
456
|
params[:id] = id
|
@@ -348,6 +460,10 @@ module Files
|
|
348
460
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
349
461
|
raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params.dig(:private_key) and !params.dig(:private_key).is_a?(String)
|
350
462
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
|
463
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params.dig(:wasabi_access_key) and !params.dig(:wasabi_access_key).is_a?(String)
|
464
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
|
465
|
+
raise InvalidParameterError.new("Bad parameter: b2_access_key must be an String") if params.dig(:b2_access_key) and !params.dig(:b2_access_key).is_a?(String)
|
466
|
+
raise InvalidParameterError.new("Bad parameter: b2_secret_key must be an String") if params.dig(:b2_secret_key) and !params.dig(:b2_secret_key).is_a?(String)
|
351
467
|
raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
|
352
468
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
353
469
|
raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
|
@@ -360,6 +476,10 @@ module Files
|
|
360
476
|
raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
|
361
477
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
|
362
478
|
raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
|
479
|
+
raise InvalidParameterError.new("Bad parameter: b2_bucket must be an String") if params.dig(:b2_bucket) and !params.dig(:b2_bucket).is_a?(String)
|
480
|
+
raise InvalidParameterError.new("Bad parameter: b2_region must be an String") if params.dig(:b2_region) and !params.dig(:b2_region).is_a?(String)
|
481
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
|
482
|
+
raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
|
363
483
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
364
484
|
|
365
485
|
response, options = Api.send_request("/remote_servers/#{params[:id]}", :patch, params, options)
|
@@ -81,6 +81,25 @@ module Files
|
|
81
81
|
@attributes[:group_ids] = value
|
82
82
|
end
|
83
83
|
|
84
|
+
# List Requests
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# page - integer - Current page number.
|
88
|
+
# per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
89
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
90
|
+
# mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
|
91
|
+
def folders(params = {})
|
92
|
+
params ||= {}
|
93
|
+
params[:path] = @attributes[:path]
|
94
|
+
raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
|
95
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
96
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
97
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
98
|
+
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
99
|
+
|
100
|
+
Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, @options)
|
101
|
+
end
|
102
|
+
|
84
103
|
# Create Request
|
85
104
|
#
|
86
105
|
# Parameters:
|
@@ -131,6 +150,24 @@ module Files
|
|
131
150
|
list(path, params, options)
|
132
151
|
end
|
133
152
|
|
153
|
+
# List Requests
|
154
|
+
#
|
155
|
+
# Parameters:
|
156
|
+
# page - integer - Current page number.
|
157
|
+
# per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
158
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
159
|
+
# mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
|
160
|
+
def self.folders(path, params = {}, options = {})
|
161
|
+
params ||= {}
|
162
|
+
params[:path] = path
|
163
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
164
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
165
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
166
|
+
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
167
|
+
|
168
|
+
response, options = Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
169
|
+
end
|
170
|
+
|
134
171
|
# Create Request
|
135
172
|
#
|
136
173
|
# Parameters:
|
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.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|