files.com 1.1.145 → 1.1.147

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48a67977717160ed7edefa9d5c8aceaacaaaf4183cc2e8b8b8c4e41d90b0d7be
4
- data.tar.gz: 1ad58a2179e6a2fe80e3bbcb88f276318053826ddb7047c9d4a3e8b12d65f204
3
+ metadata.gz: bb798851ff19d0a3d0d0edca0d08bc4a8c4e110df74f55cb99a7000195abafc7
4
+ data.tar.gz: ef479ae58069b1edc3d6013e54051e4c7355ed9fb83a7b69dbda25057a621e07
5
5
  SHA512:
6
- metadata.gz: 38cfe883d23ad8ec09fc52a3f510b248f5a3883fd43ce6c4b12c99c1016933181154f2c868f1d7dac72d168ba6c70a2ee5fdbc690e9a1f2c5f55bbf0916527f0
7
- data.tar.gz: 17aae1b8b1f354ec59f657c17c1c4ebf53ed3f47cf908c08a4463932ea5d695afca06f04c15ee376732d62b8a01b9d3abf9213379af1611de7cbe2e2992b7300
6
+ metadata.gz: 5b3d99aad929ef1185dc3461c5394a1af82a8c12ff29df98ad964a8902e98df6b590a8b9ea5a6d25427f451cb2020b8d6e64b7234a91ed8e49567b0cd3e5d4f2
7
+ data.tar.gz: f49779d948ad5ae25f774ec4d24ae6f37b96b415fefc0dc178cb2e49f0869d2476b8c0bf81193a82e0640685d19b8ef389a86d76ff6cb07cb6bde7a74d2baff1
data/README.md CHANGED
@@ -194,45 +194,18 @@ Files.max_network_retries = 5
194
194
 
195
195
  ## Sort and Filter
196
196
 
197
- Several of the Files.com API resources have list operations that return multiple instances of the resource. The List operations
198
- can be sorted and filtered.
197
+ Several of the Files.com API resources have list operations that return multiple instances of the
198
+ resource. The List operations can be sorted and filtered.
199
199
 
200
200
  ### Sorting
201
201
 
202
- The returned data can be sorted by passing in the ```sort_by``` method argument.
202
+ To sort the returned data, pass in the ```sort_by``` method argument.
203
203
 
204
- The argument value is a Ruby hash that has a key of the resource field name to sort on and a value of either ```"asc"``` or ```"desc"``` to specify the sort order.
204
+ Each resource supports a unique set of valid sort fields and can only be sorted by one field at a
205
+ time.
205
206
 
206
- Each resource has a set of valid fields for sorting and can be sorted by one field at a time.
207
-
208
- ### Filters
209
-
210
- Filters apply selection criteria to the underlying query that returns the results. Filters can be applied individually to select resource fields
211
- and/or in a combination with each other. The results of applying filters and filter combinations can be sorted by a single field.
212
-
213
- The passed in argument value is a Ruby hash that has a key of the resource field name to filter on and a passed in value to use in the filter comparison.
214
-
215
- Each resource has their own set of valid filters and fields, valid combinations of filters, and sortable fields.
216
-
217
- #### Types of Filters
218
-
219
- ##### Exact Filter
220
-
221
- `filter` - find resources that have an exact field value match to a passed in value. (i.e., FIELD_VALUE = PASS_IN_VALUE).
222
-
223
- #### Range Filters
224
-
225
- `filter_gt` - find resources that have a field value that is greater than the passed in value. (i.e., FIELD_VALUE > PASS_IN_VALUE).
226
-
227
- `filter_gte` - find resources that have a field value that is greater than or equal to the passed in value. (i.e., FIELD_VALUE >= PASS_IN_VALUE).
228
-
229
- `filter_lt` - find resources that have a field value that is less than the passed in value. (i.e., FIELD_VALUE < PASS_IN_VALUE).
230
-
231
- `filter_lte` - 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).
232
-
233
- ##### Pattern Filter
234
-
235
- `filter_prefix` - find resources where the specified field is prefixed by the supplied value. This is applicable to values that are strings.
207
+ The argument value is a Ruby hash that has a key of the resource field name to sort on and a value
208
+ of either ```"asc"``` or ```"desc"``` to specify the sort order.
236
209
 
237
210
  ```ruby title="Sort Example"
238
211
  ## users sorted by username
@@ -242,35 +215,55 @@ Files::User.list(
242
215
  )
243
216
  ```
244
217
 
218
+ ### Filtering
219
+
220
+ Filters apply selection criteria to the underlying query that returns the results. They can be
221
+ applied individually or combined with other filters, and the resulting data can be sorted by a
222
+ single field.
223
+
224
+ Each resource supports a unique set of valid filter fields, filter combinations, and combinations of
225
+ filters and sort fields.
226
+
227
+ The passed in argument value is a Ruby hash that has a key of the resource field name to filter on
228
+ and a passed in value to use in the filter comparison.
229
+
230
+ #### Filter Types
231
+
232
+ | Filter | Type | Description |
233
+ | --------- | --------- | --------- |
234
+ | `filter` | Exact | Find resources that have an exact field value match to a passed in value. (i.e., FIELD_VALUE = PASS_IN_VALUE). |
235
+ | `filter_prefix` | Pattern | Find resources where the specified field is prefixed by the supplied value. This is applicable to values that are strings. |
236
+ | `filter_gt` | Range | Find resources that have a field value that is greater than the passed in value. (i.e., FIELD_VALUE > PASS_IN_VALUE). |
237
+ | `filter_gteq` | Range | Find resources that have a field value that is greater than or equal to the passed in value. (i.e., FIELD_VALUE >= PASS_IN_VALUE). |
238
+ | `filter_lt` | Range | Find resources that have a field value that is less than the passed in value. (i.e., FIELD_VALUE < PASS_IN_VALUE). |
239
+ | `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). |
240
+
245
241
  ```ruby title="Exact Filter Example"
246
242
  ## non admin users
247
243
  Files.api_key = 'YOUR_API_KEY'
248
244
  Files::User.list(
249
- filter: { not_site_admin: true },
250
- sort_by: { "username": "asc"}
245
+ filter: { not_site_admin: true }
251
246
  )
252
247
  ```
253
248
 
254
249
  ```ruby title="Range Filter Example"
255
- #users who haven't logged in since 2024-01-01
250
+ ## users who haven't logged in since 2024-01-01
256
251
  Files.api_key = 'YOUR_API_KEY'
257
252
  Files::User.list(
258
- filter_gte: { "last_login_at": "2024-01-01" },
259
- sort_by: { "last_login_at": "asc"}
253
+ filter_gteq: { "last_login_at": "2024-01-01" }
260
254
  )
261
255
  ```
262
256
 
263
257
  ```ruby title="Pattern Filter Example"
264
- ## users who usernames start with 'test'
258
+ ## users whose usernames start with 'test'
265
259
  Files.api_key = 'YOUR_API_KEY'
266
260
  Files::User.list(
267
- filter_pre: { username: "test" },
268
- sort_by: { "username": "asc"}
261
+ filter_pre: { username: "test" }
269
262
  )
270
263
  ```
271
264
 
272
- ```ruby title="Combined Filter Example"
273
- ## users who usernames start with 'test' and are not admins
265
+ ```ruby title="Combination Filter with Sort Example"
266
+ ## users whose usernames start with 'test' and are not admins
274
267
  Files.api_key = 'YOUR_API_KEY'
275
268
  Files::User.list(
276
269
  filter_prefix: { username: "test" },
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.145
1
+ 1.1.147
data/docs/permission.md CHANGED
@@ -57,8 +57,8 @@ Files::Permission.list(
57
57
 
58
58
  ```
59
59
  Files::Permission.create(
60
+ path: "path",
60
61
  group_id: 1,
61
- path: "example",
62
62
  permission: "full",
63
63
  recursive: true,
64
64
  user_id: 1,
@@ -68,9 +68,9 @@ Files::Permission.create(
68
68
 
69
69
  ### Parameters
70
70
 
71
+ * `path` (string): Required - Folder path
71
72
  * `group_id` (int64): Group ID
72
- * `path` (string): Folder path
73
- * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
73
+ * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
74
74
  * `recursive` (boolean): Apply to subfolders recursively?
75
75
  * `user_id` (int64): User ID. Provide `username` or `user_id`
76
76
  * `username` (string): User username. Provide `username` or `user_id`
@@ -137,18 +137,19 @@ module Files
137
137
  end
138
138
 
139
139
  # Parameters:
140
+ # path (required) - string - Folder path
140
141
  # group_id - int64 - Group ID
141
- # path - string - Folder path
142
- # permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
142
+ # permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
143
143
  # recursive - boolean - Apply to subfolders recursively?
144
144
  # user_id - int64 - User ID. Provide `username` or `user_id`
145
145
  # username - string - User username. Provide `username` or `user_id`
146
146
  def self.create(params = {}, options = {})
147
- raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer)
148
147
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
148
+ raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params[:group_id] and !params[:group_id].is_a?(Integer)
149
149
  raise InvalidParameterError.new("Bad parameter: permission must be an String") if params[:permission] and !params[:permission].is_a?(String)
150
150
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
151
151
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String)
152
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
152
153
 
153
154
  response, options = Api.send_request("/permissions", :post, params, options)
154
155
  Permission.new(response.data, options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.145"
4
+ VERSION = "1.1.147"
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.145
4
+ version: 1.1.147
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-05 00:00:00.000000000 Z
11
+ date: 2024-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable