files.com 1.1.207 → 1.1.208

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +87 -34
  3. data/_VERSION +1 -1
  4. data/lib/files.com/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e320daf55d9a2f7129ec3243103cc2a5b35e398702314a49a769775cdbaad49c
4
- data.tar.gz: 1b21167c8d91faaf452e34db8a2d92caf4a6c55d5e56bc44829258b3a929b99b
3
+ metadata.gz: 841e24eb4898f1224f694a8c7d3aab281f1109bf0bae63e6fa8557fc6bd99132
4
+ data.tar.gz: b8c2f09b1891a50890792366e5bb8d67a90a276e7b1690c6a4bb84d47e17e4cc
5
5
  SHA512:
6
- metadata.gz: cae91452fcfbcce6427eeb36b8ac5d5e5b651a8fa769e4dab4ab7f834cd7b342da779ef62759e4aa39d5855eb10851d76d6c03036652f003f66ef777c7bc309a
7
- data.tar.gz: 2857c2d365ac114c36a9e7eb6a2d92724e45ff6c230af2846b2e9074e7c2b3615af182b4473430259f8a9ab72995d98a0248914f1d74c84565f8765015def4c3
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
- ## Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
73
- Files::User.new(params, api_key: 'YOUR_API_KEY')
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
- session = Files::Session.create(username: "username", password: "password")
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 = Files::Session.create(username: "username", password: "password")
119
+ Files.session = session
108
120
 
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)
111
-
112
- ## You may also specify the session ID on a per-request basis in the final parameter to static methods.
113
- Files::Group.list({}, session_id: session.id)
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
- session.destroy()
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,10 +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
- ## users sorted by username
220
- Files::User.list(
221
- sort_by: { "username": "asc"}
222
- )
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
223
252
  ```
224
253
 
225
254
  ### Filtering
@@ -246,33 +275,57 @@ and a passed in value to use in the filter comparison.
246
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). |
247
276
 
248
277
  ```ruby title="Exact Filter Example"
249
- ## non admin users
250
- Files::User.list(
251
- filter: { not_site_admin: true }
252
- )
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
253
288
  ```
254
289
 
255
290
  ```ruby title="Range Filter Example"
256
- ## users who haven't logged in since 2024-01-01
257
- Files::User.list(
258
- filter_gteq: { "last_login_at": "2024-01-01" }
259
- )
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
260
301
  ```
261
302
 
262
303
  ```ruby title="Pattern Filter Example"
263
- ## users whose usernames start with 'test'
264
- Files::User.list(
265
- filter_pre: { username: "test" }
266
- )
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
267
314
  ```
268
315
 
269
316
  ```ruby title="Combination Filter with Sort Example"
270
- ## users whose usernames start with 'test' and are not admins
271
- Files::User.list(
272
- filter_prefix: { username: "test" },
273
- filter: { not_site_admin: true },
274
- sort_by: { "username": "asc"}
275
- )
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
276
329
  ```
277
330
 
278
331
  ## Errors
@@ -296,9 +349,9 @@ rescue for general `Files::Error` as a catch-all.
296
349
  begin
297
350
  session = Files::Session.create(username: "USERNAME", password: "BADPASSWORD")
298
351
  rescue Files::NotAuthenticatedError => e
299
- puts "An Authentication Error has occurred (#{e.class.to_s}): " + e.message
352
+ puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
300
353
  rescue Files::Error => e
301
- puts "An Unknown Error has occurred (#{e.class.to_s}): " + e.message
354
+ puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
302
355
  end
303
356
  ```
304
357
 
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.207
1
+ 1.1.208
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.207"
4
+ VERSION = "1.1.208"
5
5
  end
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.207
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-08 00:00:00.000000000 Z
11
+ date: 2025-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable