files.com 1.1.206 → 1.1.208
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +87 -39
- data/_VERSION +1 -1
- data/lib/files.com/version.rb +1 -1
- 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: 841e24eb4898f1224f694a8c7d3aab281f1109bf0bae63e6fa8557fc6bd99132
|
4
|
+
data.tar.gz: b8c2f09b1891a50890792366e5bb8d67a90a276e7b1690c6a4bb84d47e17e4cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72cf7f33373f789864ec482a2a30912b1e9260dd83d4fcb3cf5fdaecc87f88c51c1271759b2e2ba0dfe4e94450216838a872485139e627b4fe684ace192be883
|
7
|
+
data.tar.gz: 4edd9ff18e3bbee8572c9a6b20edd533e9909cb944813f13a4feeb4ecd0b2c61ff2c2bd53ce22d75a97515c2d4ba229cc645c87d264b82838bf6ef6fadbf2d7e
|
data/README.md
CHANGED
@@ -69,8 +69,14 @@ that user can access, and no access will be granted to site administration funct
|
|
69
69
|
```ruby title="Example Request"
|
70
70
|
Files.api_key = 'YOUR_API_KEY'
|
71
71
|
|
72
|
-
|
73
|
-
|
72
|
+
begin
|
73
|
+
# Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
|
74
|
+
Files::User.new(params, api_key: 'YOUR_API_KEY')
|
75
|
+
rescue Files::NotAuthenticatedError => e
|
76
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
77
|
+
rescue Files::Error => e
|
78
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
79
|
+
end
|
74
80
|
```
|
75
81
|
|
76
82
|
Don't forget to replace the placeholder, `YOUR_API_KEY`, with your actual API key.
|
@@ -95,7 +101,13 @@ password.
|
|
95
101
|
This returns a session object that can be used to authenticate SDK method calls.
|
96
102
|
|
97
103
|
```ruby title="Example Request"
|
98
|
-
|
104
|
+
begin
|
105
|
+
session = Files::Session.create(username: "username", password: "password")
|
106
|
+
rescue Files::NotAuthenticatedError => e
|
107
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
108
|
+
rescue Files::Error => e
|
109
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
110
|
+
end
|
99
111
|
```
|
100
112
|
|
101
113
|
#### Using a Session
|
@@ -104,14 +116,19 @@ Once a session has been created, you can store the session globally, use the ses
|
|
104
116
|
|
105
117
|
```ruby title="Example Requests"
|
106
118
|
## You may set the returned session to be used by default for subsequent requests.
|
107
|
-
Files.session =
|
108
|
-
|
109
|
-
## Alternatively, you can specify the session ID on a per-object basis in the second parameter to a model constructor.
|
110
|
-
user = Files::User.new(params, session_id: session.id)
|
119
|
+
Files.session = session
|
111
120
|
|
112
|
-
|
113
|
-
|
121
|
+
begin
|
122
|
+
# Alternatively, you can specify the session ID on a per-object basis in the second parameter to a model constructor.
|
123
|
+
user = Files::User.new(params, session_id: session.id)
|
114
124
|
|
125
|
+
# You may also specify the session ID on a per-request basis in the final parameter to static methods.
|
126
|
+
Files::Group.list({}, session_id: session.id)
|
127
|
+
rescue Files::NotAuthenticatedError => e
|
128
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
129
|
+
rescue Files::Error => e
|
130
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
131
|
+
end
|
115
132
|
```
|
116
133
|
|
117
134
|
#### Logging Out
|
@@ -119,7 +136,13 @@ Files::Group.list({}, session_id: session.id)
|
|
119
136
|
User sessions can be ended calling the `destroy` method on the `session` object.
|
120
137
|
|
121
138
|
```ruby title="Example Request"
|
122
|
-
|
139
|
+
begin
|
140
|
+
session.destroy()
|
141
|
+
rescue Files::NotAuthenticatedError => e
|
142
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
143
|
+
rescue Files::Error => e
|
144
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
145
|
+
end
|
123
146
|
```
|
124
147
|
|
125
148
|
## Configuration
|
@@ -216,11 +239,16 @@ The argument value is a Ruby hash that has a key of the resource field name to s
|
|
216
239
|
of either ```"asc"``` or ```"desc"``` to specify the sort order.
|
217
240
|
|
218
241
|
```ruby title="Sort Example"
|
219
|
-
|
220
|
-
|
221
|
-
Files::User.list(
|
222
|
-
|
223
|
-
)
|
242
|
+
begin
|
243
|
+
# users sorted by username
|
244
|
+
Files::User.list(
|
245
|
+
sort_by: { "username": "asc" }
|
246
|
+
)
|
247
|
+
rescue Files::NotAuthenticatedError => e
|
248
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
249
|
+
rescue Files::Error => e
|
250
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
251
|
+
end
|
224
252
|
```
|
225
253
|
|
226
254
|
### Filtering
|
@@ -247,37 +275,57 @@ and a passed in value to use in the filter comparison.
|
|
247
275
|
| `filter_lteq` | Range | Find resources that have a field value that is less than or equal to the passed in value. (i.e., FIELD_VALUE \<= PASS_IN_VALUE). |
|
248
276
|
|
249
277
|
```ruby title="Exact Filter Example"
|
250
|
-
|
251
|
-
|
252
|
-
Files::User.list(
|
253
|
-
|
254
|
-
)
|
278
|
+
begin
|
279
|
+
# non admin users
|
280
|
+
Files::User.list(
|
281
|
+
filter: { not_site_admin: true }
|
282
|
+
)
|
283
|
+
rescue Files::NotAuthenticatedError => e
|
284
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
285
|
+
rescue Files::Error => e
|
286
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
287
|
+
end
|
255
288
|
```
|
256
289
|
|
257
290
|
```ruby title="Range Filter Example"
|
258
|
-
|
259
|
-
|
260
|
-
Files::User.list(
|
261
|
-
|
262
|
-
)
|
291
|
+
begin
|
292
|
+
# users who haven't logged in since 2024-01-01
|
293
|
+
Files::User.list(
|
294
|
+
filter_gteq: { "last_login_at": "2024-01-01" }
|
295
|
+
)
|
296
|
+
rescue Files::NotAuthenticatedError => e
|
297
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
298
|
+
rescue Files::Error => e
|
299
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
300
|
+
end
|
263
301
|
```
|
264
302
|
|
265
303
|
```ruby title="Pattern Filter Example"
|
266
|
-
|
267
|
-
|
268
|
-
Files::User.list(
|
269
|
-
|
270
|
-
)
|
304
|
+
begin
|
305
|
+
# users whose usernames start with 'test'
|
306
|
+
Files::User.list(
|
307
|
+
filter_pre: { username: "test" }
|
308
|
+
)
|
309
|
+
rescue Files::NotAuthenticatedError => e
|
310
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
311
|
+
rescue Files::Error => e
|
312
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
313
|
+
end
|
271
314
|
```
|
272
315
|
|
273
316
|
```ruby title="Combination Filter with Sort Example"
|
274
|
-
|
275
|
-
|
276
|
-
Files::User.list(
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
)
|
317
|
+
begin
|
318
|
+
# users whose usernames start with 'test' and are not admins
|
319
|
+
Files::User.list(
|
320
|
+
filter_prefix: { username: "test" },
|
321
|
+
filter: { not_site_admin: true },
|
322
|
+
sort_by: { "username": "asc" }
|
323
|
+
)
|
324
|
+
rescue Files::NotAuthenticatedError => e
|
325
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
326
|
+
rescue Files::Error => e
|
327
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
328
|
+
end
|
281
329
|
```
|
282
330
|
|
283
331
|
## Errors
|
@@ -301,9 +349,9 @@ rescue for general `Files::Error` as a catch-all.
|
|
301
349
|
begin
|
302
350
|
session = Files::Session.create(username: "USERNAME", password: "BADPASSWORD")
|
303
351
|
rescue Files::NotAuthenticatedError => e
|
304
|
-
puts "
|
352
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
305
353
|
rescue Files::Error => e
|
306
|
-
puts "
|
354
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
307
355
|
end
|
308
356
|
```
|
309
357
|
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.208
|
data/lib/files.com/version.rb
CHANGED
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.208
|
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-01-
|
11
|
+
date: 2025-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|