files.com 1.0.75 → 1.0.80
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/api_key.md +25 -25
- data/docs/bundle.md +19 -3
- data/docs/bundle_download.md +35 -0
- data/docs/remote_server.md +8 -8
- data/docs/site.md +4 -0
- data/docs/user_request.md +93 -0
- data/lib/files.com.rb +2 -0
- data/lib/files.com/list.rb +1 -1
- data/lib/files.com/models/api_key.rb +17 -17
- data/lib/files.com/models/bundle.rb +30 -0
- data/lib/files.com/models/bundle_download.rb +49 -0
- data/lib/files.com/models/remote_server.rb +4 -4
- data/lib/files.com/models/site.rb +6 -0
- data/lib/files.com/models/user_request.rb +127 -0
- data/spec/list_spec.rb +24 -2
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4853b6244fc875ee850f59c63fe883fd68cfaaaf36415985fbdcc74735d966d8
|
4
|
+
data.tar.gz: 194e5633e68ef1d24518345cab7cf1968117dde31d0b73394346f13b922a8f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4fccf56177f29e5c33a9337db5945305922688e85ebfb83dd5fb65e620527f85a675e3150769ceb700a0662be7122c2e86665f8920e2396b67a9debd245bc2c
|
7
|
+
data.tar.gz: 663ed920eec49bb22b4a4908e67784948bee85264360e1771275042918626235e20447518ddd817e42cd1947e8c9e0d5cdf245a7700d7192d2a0308158b15928
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.80
|
data/docs/api_key.md
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
* `key` (string): API Key actual key string
|
25
25
|
* `last_use_at` (date-time): API Key last used - note this value is only updated once per 3 hour period, so the 'actual' time of last use may be up to 3 hours later than this timestamp.
|
26
26
|
* `name` (string): Internal name for the API Key. For your use.
|
27
|
-
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations.
|
27
|
+
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
28
28
|
* `platform` (string): If this API key represents a Desktop app, what platform was it created on?
|
29
29
|
* `user_id` (int64): User ID for the owner of this API Key. May be blank for Site-wide API Keys.
|
30
30
|
|
@@ -78,18 +78,18 @@ Files::ApiKey.find(id)
|
|
78
78
|
```
|
79
79
|
Files::ApiKey.create(
|
80
80
|
user_id: 1,
|
81
|
-
name: "My Key",
|
82
|
-
|
83
|
-
|
81
|
+
name: "My Main API Key",
|
82
|
+
expires_at: "2000-01-01T01:00:00Z",
|
83
|
+
permission_set: "full"
|
84
84
|
)
|
85
85
|
```
|
86
86
|
|
87
87
|
### Parameters
|
88
88
|
|
89
89
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
90
|
-
* `name` (string): Internal name for
|
91
|
-
* `
|
92
|
-
* `
|
90
|
+
* `name` (string): Internal name for the API Key. For your use.
|
91
|
+
* `expires_at` (string): API Key expiration date
|
92
|
+
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
93
93
|
|
94
94
|
|
95
95
|
---
|
@@ -98,17 +98,17 @@ Files::ApiKey.create(
|
|
98
98
|
|
99
99
|
```
|
100
100
|
Files::ApiKey.update_current(
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
expires_at: "2000-01-01T01:00:00Z",
|
102
|
+
name: "My Main API Key",
|
103
|
+
permission_set: "full"
|
104
104
|
)
|
105
105
|
```
|
106
106
|
|
107
107
|
### Parameters
|
108
108
|
|
109
|
-
* `
|
110
|
-
* `
|
111
|
-
* `
|
109
|
+
* `expires_at` (string): API Key expiration date
|
110
|
+
* `name` (string): Internal name for the API Key. For your use.
|
111
|
+
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
112
112
|
|
113
113
|
|
114
114
|
---
|
@@ -117,18 +117,18 @@ Files::ApiKey.update_current(
|
|
117
117
|
|
118
118
|
```
|
119
119
|
Files::ApiKey.update(id,
|
120
|
-
name: "My Key",
|
121
|
-
|
122
|
-
|
120
|
+
name: "My Main API Key",
|
121
|
+
expires_at: "2000-01-01T01:00:00Z",
|
122
|
+
permission_set: "full"
|
123
123
|
)
|
124
124
|
```
|
125
125
|
|
126
126
|
### Parameters
|
127
127
|
|
128
128
|
* `id` (int64): Required - Api Key ID.
|
129
|
-
* `name` (string): Internal name for
|
130
|
-
* `
|
131
|
-
* `
|
129
|
+
* `name` (string): Internal name for the API Key. For your use.
|
130
|
+
* `expires_at` (string): API Key expiration date
|
131
|
+
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
132
132
|
|
133
133
|
|
134
134
|
---
|
@@ -161,18 +161,18 @@ Files::ApiKey.delete(id)
|
|
161
161
|
api_key = Files::ApiKey.list_for(path).first
|
162
162
|
|
163
163
|
api_key.update(
|
164
|
-
name: "My Key",
|
165
|
-
|
166
|
-
|
164
|
+
name: "My Main API Key",
|
165
|
+
expires_at: "2000-01-01T01:00:00Z",
|
166
|
+
permission_set: "full"
|
167
167
|
)
|
168
168
|
```
|
169
169
|
|
170
170
|
### Parameters
|
171
171
|
|
172
172
|
* `id` (int64): Required - Api Key ID.
|
173
|
-
* `name` (string): Internal name for
|
174
|
-
* `
|
175
|
-
* `
|
173
|
+
* `name` (string): Internal name for the API Key. For your use.
|
174
|
+
* `expires_at` (string): API Key expiration date
|
175
|
+
* `permission_set` (string): Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
176
176
|
|
177
177
|
|
178
178
|
---
|
data/docs/bundle.md
CHANGED
@@ -13,10 +13,12 @@
|
|
13
13
|
"id": 1,
|
14
14
|
"created_at": "2000-01-01T01:00:00Z",
|
15
15
|
"expires_at": "2000-01-01T01:00:00Z",
|
16
|
+
"max_uses": 1,
|
16
17
|
"note": "The internal note on the bundle.",
|
17
18
|
"user_id": 1,
|
18
19
|
"username": "user",
|
19
20
|
"clickwrap_id": 1,
|
21
|
+
"inbox_id": 1,
|
20
22
|
"paths": [
|
21
23
|
|
22
24
|
]
|
@@ -32,10 +34,12 @@
|
|
32
34
|
* `id` (int64): Bundle ID
|
33
35
|
* `created_at` (date-time): Bundle created at date/time
|
34
36
|
* `expires_at` (date-time): Bundle expiration date/time
|
37
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
35
38
|
* `note` (string): Bundle internal note
|
36
39
|
* `user_id` (int64): Bundle creator user ID
|
37
40
|
* `username` (string): Bundle creator username
|
38
41
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
42
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
39
43
|
* `paths` (array): A list of paths in this bundle
|
40
44
|
* `password` (string): Password for this bundle.
|
41
45
|
|
@@ -83,11 +87,13 @@ Files::Bundle.create(
|
|
83
87
|
paths: ["file.txt"],
|
84
88
|
password: "Password",
|
85
89
|
expires_at: "2000-01-01T01:00:00Z",
|
90
|
+
max_uses: 1,
|
86
91
|
description: "The public description of the bundle.",
|
87
92
|
note: "The internal note on the bundle.",
|
88
93
|
code: "abc123",
|
89
94
|
require_registration: true,
|
90
|
-
clickwrap_id: 1
|
95
|
+
clickwrap_id: 1,
|
96
|
+
inbox_id: 1
|
91
97
|
)
|
92
98
|
```
|
93
99
|
|
@@ -97,11 +103,13 @@ Files::Bundle.create(
|
|
97
103
|
* `paths` (array(string)): Required - A list of paths to include in this bundle.
|
98
104
|
* `password` (string): Password for this bundle.
|
99
105
|
* `expires_at` (string): Bundle expiration date/time
|
106
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
100
107
|
* `description` (string): Public description
|
101
108
|
* `note` (string): Bundle internal note
|
102
109
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
103
110
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
104
111
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
112
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
105
113
|
|
106
114
|
|
107
115
|
---
|
@@ -130,11 +138,13 @@ Files::Bundle.share(id,
|
|
130
138
|
Files::Bundle.update(id,
|
131
139
|
password: "Password",
|
132
140
|
expires_at: "2000-01-01T01:00:00Z",
|
141
|
+
max_uses: 1,
|
133
142
|
description: "The public description of the bundle.",
|
134
143
|
note: "The internal note on the bundle.",
|
135
144
|
code: "abc123",
|
136
145
|
require_registration: true,
|
137
|
-
clickwrap_id: 1
|
146
|
+
clickwrap_id: 1,
|
147
|
+
inbox_id: 1
|
138
148
|
)
|
139
149
|
```
|
140
150
|
|
@@ -143,11 +153,13 @@ Files::Bundle.update(id,
|
|
143
153
|
* `id` (int64): Required - Bundle ID.
|
144
154
|
* `password` (string): Password for this bundle.
|
145
155
|
* `expires_at` (string): Bundle expiration date/time
|
156
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
146
157
|
* `description` (string): Public description
|
147
158
|
* `note` (string): Bundle internal note
|
148
159
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
149
160
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
150
161
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
162
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
151
163
|
|
152
164
|
|
153
165
|
---
|
@@ -193,11 +205,13 @@ bundle = Files::Bundle.list_for(path).first
|
|
193
205
|
bundle.update(
|
194
206
|
password: "Password",
|
195
207
|
expires_at: "2000-01-01T01:00:00Z",
|
208
|
+
max_uses: 1,
|
196
209
|
description: "The public description of the bundle.",
|
197
210
|
note: "The internal note on the bundle.",
|
198
211
|
code: "abc123",
|
199
212
|
require_registration: true,
|
200
|
-
clickwrap_id: 1
|
213
|
+
clickwrap_id: 1,
|
214
|
+
inbox_id: 1
|
201
215
|
)
|
202
216
|
```
|
203
217
|
|
@@ -206,11 +220,13 @@ bundle.update(
|
|
206
220
|
* `id` (int64): Required - Bundle ID.
|
207
221
|
* `password` (string): Password for this bundle.
|
208
222
|
* `expires_at` (string): Bundle expiration date/time
|
223
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
209
224
|
* `description` (string): Public description
|
210
225
|
* `note` (string): Bundle internal note
|
211
226
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
212
227
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
213
228
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
229
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
214
230
|
|
215
231
|
|
216
232
|
---
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# BundleDownload
|
2
|
+
|
3
|
+
## Example BundleDownload Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"download_method": "file",
|
8
|
+
"path": "a/b/test.txt",
|
9
|
+
"created_at": "2020-01-01 00:00:00"
|
10
|
+
}
|
11
|
+
```
|
12
|
+
|
13
|
+
* `download_method` (string): Download method (file or full_zip)
|
14
|
+
* `path` (string): Download path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
15
|
+
* `created_at` (date-time): Download date/time
|
16
|
+
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
## List Bundle Downloads
|
21
|
+
|
22
|
+
```
|
23
|
+
Files::BundleDownload.list(
|
24
|
+
page: 1,
|
25
|
+
per_page: 1,
|
26
|
+
bundle_registration_id: 1
|
27
|
+
)
|
28
|
+
```
|
29
|
+
|
30
|
+
### Parameters
|
31
|
+
|
32
|
+
* `page` (int64): Current page number.
|
33
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
34
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
35
|
+
* `bundle_registration_id` (int64): Required - BundleRegistration ID
|
data/docs/remote_server.md
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
"auth_setup_link": "auth/:provider",
|
30
30
|
"auth_status": "in_setup",
|
31
31
|
"auth_account_name": "me@example.com",
|
32
|
-
"one_drive_account_type": "
|
32
|
+
"one_drive_account_type": "personal"
|
33
33
|
}
|
34
34
|
```
|
35
35
|
|
@@ -58,7 +58,7 @@
|
|
58
58
|
* `auth_setup_link` (string): Returns link to login with an Oauth provider
|
59
59
|
* `auth_status` (string): Either `in_setup` or `complete`
|
60
60
|
* `auth_account_name` (string): Describes the authorized account
|
61
|
-
* `one_drive_account_type` (string): Either
|
61
|
+
* `one_drive_account_type` (string): Either personal or business_other account types
|
62
62
|
* `aws_access_key` (string): AWS Access Key.
|
63
63
|
* `aws_secret_key` (string): AWS secret key.
|
64
64
|
* `password` (string): Password if needed.
|
@@ -130,7 +130,7 @@ Files::RemoteServer.create(
|
|
130
130
|
rackspace_username: "rackspaceuser",
|
131
131
|
rackspace_region: "dfw",
|
132
132
|
rackspace_container: "my-container",
|
133
|
-
one_drive_account_type: "
|
133
|
+
one_drive_account_type: "personal"
|
134
134
|
)
|
135
135
|
```
|
136
136
|
|
@@ -167,7 +167,7 @@ Files::RemoteServer.create(
|
|
167
167
|
* `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
|
168
168
|
* `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
169
169
|
* `rackspace_container` (string): The name of the container (top level directory) where files will sync.
|
170
|
-
* `one_drive_account_type` (string): Either
|
170
|
+
* `one_drive_account_type` (string): Either personal or business_other account types
|
171
171
|
|
172
172
|
|
173
173
|
---
|
@@ -197,7 +197,7 @@ Files::RemoteServer.update(id,
|
|
197
197
|
rackspace_username: "rackspaceuser",
|
198
198
|
rackspace_region: "dfw",
|
199
199
|
rackspace_container: "my-container",
|
200
|
-
one_drive_account_type: "
|
200
|
+
one_drive_account_type: "personal"
|
201
201
|
)
|
202
202
|
```
|
203
203
|
|
@@ -235,7 +235,7 @@ Files::RemoteServer.update(id,
|
|
235
235
|
* `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
|
236
236
|
* `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
237
237
|
* `rackspace_container` (string): The name of the container (top level directory) where files will sync.
|
238
|
-
* `one_drive_account_type` (string): Either
|
238
|
+
* `one_drive_account_type` (string): Either personal or business_other account types
|
239
239
|
|
240
240
|
|
241
241
|
---
|
@@ -280,7 +280,7 @@ remote_server.update(
|
|
280
280
|
rackspace_username: "rackspaceuser",
|
281
281
|
rackspace_region: "dfw",
|
282
282
|
rackspace_container: "my-container",
|
283
|
-
one_drive_account_type: "
|
283
|
+
one_drive_account_type: "personal"
|
284
284
|
)
|
285
285
|
```
|
286
286
|
|
@@ -318,7 +318,7 @@ remote_server.update(
|
|
318
318
|
* `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
|
319
319
|
* `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
320
320
|
* `rackspace_container` (string): The name of the container (top level directory) where files will sync.
|
321
|
-
* `one_drive_account_type` (string): Either
|
321
|
+
* `one_drive_account_type` (string): Either personal or business_other account types
|
322
322
|
|
323
323
|
|
324
324
|
---
|
data/docs/site.md
CHANGED
@@ -106,6 +106,7 @@
|
|
106
106
|
"user_lockout_lock_period": 1,
|
107
107
|
"user_lockout_tries": 1,
|
108
108
|
"user_lockout_within": 6,
|
109
|
+
"user_requests_enabled": true,
|
109
110
|
"welcome_custom_text": "Welcome to my site!",
|
110
111
|
"welcome_email_cc": "",
|
111
112
|
"welcome_email_enabled": true,
|
@@ -217,6 +218,7 @@
|
|
217
218
|
* `user_lockout_lock_period` (int64): How many hours to lock user out for failed password?
|
218
219
|
* `user_lockout_tries` (int64): Number of login tries within `user_lockout_within` hours before users are locked out
|
219
220
|
* `user_lockout_within` (int64): Number of hours for user lockout window
|
221
|
+
* `user_requests_enabled` (boolean): Enable User Requests feature
|
220
222
|
* `welcome_custom_text` (string): Custom text send in user welcome email
|
221
223
|
* `welcome_email_cc` (email): Include this email in welcome emails if enabled
|
222
224
|
* `welcome_email_enabled` (boolean): Will the welcome email be sent to new users?
|
@@ -298,6 +300,7 @@ Files::Site.update(
|
|
298
300
|
non_sso_groups_allowed: true,
|
299
301
|
non_sso_users_allowed: true,
|
300
302
|
sharing_enabled: true,
|
303
|
+
user_requests_enabled: true,
|
301
304
|
allowed_2fa_method_sms: true,
|
302
305
|
allowed_2fa_method_u2f: true,
|
303
306
|
allowed_2fa_method_totp: true,
|
@@ -389,6 +392,7 @@ Files::Site.update(
|
|
389
392
|
* `non_sso_groups_allowed` (boolean): If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider.
|
390
393
|
* `non_sso_users_allowed` (boolean): If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider.
|
391
394
|
* `sharing_enabled` (boolean): Allow bundle creation
|
395
|
+
* `user_requests_enabled` (boolean): Enable User Requests feature
|
392
396
|
* `allowed_2fa_method_sms` (boolean): Is SMS two factor authentication allowed?
|
393
397
|
* `allowed_2fa_method_u2f` (boolean): Is U2F two factor authentication allowed?
|
394
398
|
* `allowed_2fa_method_totp` (boolean): Is TOTP two factor authentication allowed?
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# UserRequest
|
2
|
+
|
3
|
+
## Example UserRequest Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"name": "John Doe",
|
8
|
+
"email": "john.doe@files.com",
|
9
|
+
"details": "Changed Departments"
|
10
|
+
}
|
11
|
+
```
|
12
|
+
|
13
|
+
* `name` (string): User's full name
|
14
|
+
* `email` (email): User email address
|
15
|
+
* `details` (string): Details of the user's request
|
16
|
+
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
## List User Requests
|
21
|
+
|
22
|
+
```
|
23
|
+
Files::UserRequest.list(
|
24
|
+
page: 1,
|
25
|
+
per_page: 1
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
29
|
+
### Parameters
|
30
|
+
|
31
|
+
* `page` (int64): Current page number.
|
32
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
33
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
34
|
+
|
35
|
+
|
36
|
+
---
|
37
|
+
|
38
|
+
## Show User Request
|
39
|
+
|
40
|
+
```
|
41
|
+
Files::UserRequest.find(id)
|
42
|
+
```
|
43
|
+
|
44
|
+
### Parameters
|
45
|
+
|
46
|
+
* `id` (int64): Required - User Request ID.
|
47
|
+
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
## Create User Request
|
52
|
+
|
53
|
+
```
|
54
|
+
Files::UserRequest.create(
|
55
|
+
name: "name",
|
56
|
+
email: "email",
|
57
|
+
details: "details"
|
58
|
+
)
|
59
|
+
```
|
60
|
+
|
61
|
+
### Parameters
|
62
|
+
|
63
|
+
* `name` (string): Required - Name of user requested
|
64
|
+
* `email` (string): Required - Email of user requested
|
65
|
+
* `details` (string): Required - Details of the user request
|
66
|
+
|
67
|
+
|
68
|
+
---
|
69
|
+
|
70
|
+
## Delete User Request
|
71
|
+
|
72
|
+
```
|
73
|
+
Files::UserRequest.delete(id)
|
74
|
+
```
|
75
|
+
|
76
|
+
### Parameters
|
77
|
+
|
78
|
+
* `id` (int64): Required - User Request ID.
|
79
|
+
|
80
|
+
|
81
|
+
---
|
82
|
+
|
83
|
+
## Delete User Request
|
84
|
+
|
85
|
+
```
|
86
|
+
user_request = Files::UserRequest.list_for(path).first
|
87
|
+
|
88
|
+
user_request.delete
|
89
|
+
```
|
90
|
+
|
91
|
+
### Parameters
|
92
|
+
|
93
|
+
* `id` (int64): Required - User Request ID.
|
data/lib/files.com.rb
CHANGED
@@ -34,6 +34,7 @@ require "files.com/models/auto"
|
|
34
34
|
require "files.com/models/automation"
|
35
35
|
require "files.com/models/behavior"
|
36
36
|
require "files.com/models/bundle"
|
37
|
+
require "files.com/models/bundle_download"
|
37
38
|
require "files.com/models/clickwrap"
|
38
39
|
require "files.com/models/dns_record"
|
39
40
|
require "files.com/models/errors"
|
@@ -74,6 +75,7 @@ require "files.com/models/usage_daily_snapshot"
|
|
74
75
|
require "files.com/models/usage_snapshot"
|
75
76
|
require "files.com/models/user"
|
76
77
|
require "files.com/models/user_cipher_use"
|
78
|
+
require "files.com/models/user_request"
|
77
79
|
|
78
80
|
require "files.com/models/dir"
|
79
81
|
require "files.com/models/file_utils"
|
data/lib/files.com/list.rb
CHANGED
@@ -68,7 +68,7 @@ module Files
|
|
68
68
|
@attributes[:name] = value
|
69
69
|
end
|
70
70
|
|
71
|
-
# string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations.
|
71
|
+
# string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
72
72
|
def permission_set
|
73
73
|
@attributes[:permission_set]
|
74
74
|
end
|
@@ -96,17 +96,17 @@ module Files
|
|
96
96
|
end
|
97
97
|
|
98
98
|
# Parameters:
|
99
|
-
# name - string - Internal name for
|
100
|
-
#
|
101
|
-
#
|
99
|
+
# name - string - Internal name for the API Key. For your use.
|
100
|
+
# expires_at - string - API Key expiration date
|
101
|
+
# permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
102
102
|
def update(params = {})
|
103
103
|
params ||= {}
|
104
104
|
params[:id] = @attributes[:id]
|
105
105
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
106
106
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
107
107
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
108
|
-
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
109
108
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
109
|
+
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
110
110
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
111
111
|
|
112
112
|
Api.send_request("/api_keys/#{@attributes[:id]}", :patch, params, @options)
|
@@ -179,43 +179,43 @@ module Files
|
|
179
179
|
|
180
180
|
# Parameters:
|
181
181
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
182
|
-
# name - string - Internal name for
|
183
|
-
#
|
184
|
-
#
|
182
|
+
# name - string - Internal name for the API Key. For your use.
|
183
|
+
# expires_at - string - API Key expiration date
|
184
|
+
# permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
185
185
|
def self.create(params = {}, options = {})
|
186
186
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
187
187
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
188
|
-
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
189
188
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
189
|
+
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
190
190
|
|
191
191
|
response, options = Api.send_request("/api_keys", :post, params, options)
|
192
192
|
ApiKey.new(response.data, options)
|
193
193
|
end
|
194
194
|
|
195
195
|
# Parameters:
|
196
|
-
#
|
197
|
-
#
|
198
|
-
#
|
196
|
+
# expires_at - string - API Key expiration date
|
197
|
+
# name - string - Internal name for the API Key. For your use.
|
198
|
+
# permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
199
199
|
def self.update_current(params = {}, options = {})
|
200
|
+
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
201
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
201
202
|
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
202
|
-
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
203
203
|
|
204
204
|
response, options = Api.send_request("/api_key", :patch, params, options)
|
205
205
|
ApiKey.new(response.data, options)
|
206
206
|
end
|
207
207
|
|
208
208
|
# Parameters:
|
209
|
-
# name - string - Internal name for
|
210
|
-
#
|
211
|
-
#
|
209
|
+
# name - string - Internal name for the API Key. For your use.
|
210
|
+
# expires_at - string - API Key expiration date
|
211
|
+
# permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
|
212
212
|
def self.update(id, params = {}, options = {})
|
213
213
|
params ||= {}
|
214
214
|
params[:id] = id
|
215
215
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
216
216
|
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
217
|
-
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
218
217
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
218
|
+
raise InvalidParameterError.new("Bad parameter: permission_set must be an String") if params.dig(:permission_set) and !params.dig(:permission_set).is_a?(String)
|
219
219
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
220
220
|
|
221
221
|
response, options = Api.send_request("/api_keys/#{params[:id]}", :patch, params, options)
|
@@ -86,6 +86,15 @@ module Files
|
|
86
86
|
@attributes[:expires_at] = value
|
87
87
|
end
|
88
88
|
|
89
|
+
# int64 - Maximum number of times bundle can be accessed
|
90
|
+
def max_uses
|
91
|
+
@attributes[:max_uses]
|
92
|
+
end
|
93
|
+
|
94
|
+
def max_uses=(value)
|
95
|
+
@attributes[:max_uses] = value
|
96
|
+
end
|
97
|
+
|
89
98
|
# string - Bundle internal note
|
90
99
|
def note
|
91
100
|
@attributes[:note]
|
@@ -122,6 +131,15 @@ module Files
|
|
122
131
|
@attributes[:clickwrap_id] = value
|
123
132
|
end
|
124
133
|
|
134
|
+
# int64 - ID of the associated inbox, if available.
|
135
|
+
def inbox_id
|
136
|
+
@attributes[:inbox_id]
|
137
|
+
end
|
138
|
+
|
139
|
+
def inbox_id=(value)
|
140
|
+
@attributes[:inbox_id] = value
|
141
|
+
end
|
142
|
+
|
125
143
|
# array - A list of paths in this bundle
|
126
144
|
def paths
|
127
145
|
@attributes[:paths]
|
@@ -161,11 +179,13 @@ module Files
|
|
161
179
|
# Parameters:
|
162
180
|
# password - string - Password for this bundle.
|
163
181
|
# expires_at - string - Bundle expiration date/time
|
182
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
164
183
|
# description - string - Public description
|
165
184
|
# note - string - Bundle internal note
|
166
185
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
167
186
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
168
187
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
188
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
169
189
|
def update(params = {})
|
170
190
|
params ||= {}
|
171
191
|
params[:id] = @attributes[:id]
|
@@ -173,10 +193,12 @@ module Files
|
|
173
193
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
174
194
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
175
195
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
196
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
176
197
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
177
198
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
178
199
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
179
200
|
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
201
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
180
202
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
181
203
|
|
182
204
|
Api.send_request("/bundles/#{@attributes[:id]}", :patch, params, @options)
|
@@ -247,20 +269,24 @@ module Files
|
|
247
269
|
# paths (required) - array(string) - A list of paths to include in this bundle.
|
248
270
|
# password - string - Password for this bundle.
|
249
271
|
# expires_at - string - Bundle expiration date/time
|
272
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
250
273
|
# description - string - Public description
|
251
274
|
# note - string - Bundle internal note
|
252
275
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
253
276
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
254
277
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
278
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
255
279
|
def self.create(params = {}, options = {})
|
256
280
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
257
281
|
raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params.dig(:paths) and !params.dig(:paths).is_a?(Array)
|
258
282
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
259
283
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
284
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
260
285
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
261
286
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
262
287
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
263
288
|
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
289
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
264
290
|
raise MissingParameterError.new("Parameter missing: paths") unless params.dig(:paths)
|
265
291
|
|
266
292
|
response, options = Api.send_request("/bundles", :post, params, options)
|
@@ -288,21 +314,25 @@ module Files
|
|
288
314
|
# Parameters:
|
289
315
|
# password - string - Password for this bundle.
|
290
316
|
# expires_at - string - Bundle expiration date/time
|
317
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
291
318
|
# description - string - Public description
|
292
319
|
# note - string - Bundle internal note
|
293
320
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
294
321
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
295
322
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
323
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
296
324
|
def self.update(id, params = {}, options = {})
|
297
325
|
params ||= {}
|
298
326
|
params[:id] = id
|
299
327
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
300
328
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
301
329
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
330
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
302
331
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
303
332
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
304
333
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
305
334
|
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
335
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
306
336
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
307
337
|
|
308
338
|
response, options = Api.send_request("/bundles/#{params[:id]}", :patch, params, options)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class BundleDownload
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# string - Download method (file or full_zip)
|
13
|
+
def download_method
|
14
|
+
@attributes[:download_method]
|
15
|
+
end
|
16
|
+
|
17
|
+
# string - Download path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
18
|
+
def path
|
19
|
+
@attributes[:path]
|
20
|
+
end
|
21
|
+
|
22
|
+
# date-time - Download date/time
|
23
|
+
def created_at
|
24
|
+
@attributes[:created_at]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Parameters:
|
28
|
+
# page - int64 - Current page number.
|
29
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
30
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
31
|
+
# bundle_registration_id (required) - int64 - BundleRegistration ID
|
32
|
+
def self.list(params = {}, options = {})
|
33
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
34
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
35
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
36
|
+
raise InvalidParameterError.new("Bad parameter: bundle_registration_id must be an Integer") if params.dig(:bundle_registration_id) and !params.dig(:bundle_registration_id).is_a?(Integer)
|
37
|
+
raise MissingParameterError.new("Parameter missing: bundle_registration_id") unless params.dig(:bundle_registration_id)
|
38
|
+
|
39
|
+
response, options = Api.send_request("/bundle_downloads", :get, params, options)
|
40
|
+
response.data.map do |entity_data|
|
41
|
+
BundleDownload.new(entity_data, options)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.all(params = {}, options = {})
|
46
|
+
list(params, options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -234,7 +234,7 @@ module Files
|
|
234
234
|
@attributes[:auth_account_name] = value
|
235
235
|
end
|
236
236
|
|
237
|
-
# string - Either
|
237
|
+
# string - Either personal or business_other account types
|
238
238
|
def one_drive_account_type
|
239
239
|
@attributes[:one_drive_account_type]
|
240
240
|
end
|
@@ -374,7 +374,7 @@ module Files
|
|
374
374
|
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
375
375
|
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
376
376
|
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
377
|
-
# one_drive_account_type - string - Either
|
377
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
378
378
|
def update(params = {})
|
379
379
|
params ||= {}
|
380
380
|
params[:id] = @attributes[:id]
|
@@ -506,7 +506,7 @@ module Files
|
|
506
506
|
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
507
507
|
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
508
508
|
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
509
|
-
# one_drive_account_type - string - Either
|
509
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
510
510
|
def self.create(params = {}, options = {})
|
511
511
|
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)
|
512
512
|
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)
|
@@ -576,7 +576,7 @@ module Files
|
|
576
576
|
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
577
577
|
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
578
578
|
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
579
|
-
# one_drive_account_type - string - Either
|
579
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
580
580
|
def self.update(id, params = {}, options = {})
|
581
581
|
params ||= {}
|
582
582
|
params[:id] = id
|
@@ -519,6 +519,11 @@ module Files
|
|
519
519
|
@attributes[:user_lockout_within]
|
520
520
|
end
|
521
521
|
|
522
|
+
# boolean - Enable User Requests feature
|
523
|
+
def user_requests_enabled
|
524
|
+
@attributes[:user_requests_enabled]
|
525
|
+
end
|
526
|
+
|
522
527
|
# string - Custom text send in user welcome email
|
523
528
|
def welcome_custom_text
|
524
529
|
@attributes[:welcome_custom_text]
|
@@ -611,6 +616,7 @@ module Files
|
|
611
616
|
# non_sso_groups_allowed - boolean - If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider.
|
612
617
|
# non_sso_users_allowed - boolean - If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider.
|
613
618
|
# sharing_enabled - boolean - Allow bundle creation
|
619
|
+
# user_requests_enabled - boolean - Enable User Requests feature
|
614
620
|
# allowed_2fa_method_sms - boolean - Is SMS two factor authentication allowed?
|
615
621
|
# allowed_2fa_method_u2f - boolean - Is U2F two factor authentication allowed?
|
616
622
|
# allowed_2fa_method_totp - boolean - Is TOTP two factor authentication allowed?
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class UserRequest
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# string - User's full name
|
13
|
+
def name
|
14
|
+
@attributes[:name]
|
15
|
+
end
|
16
|
+
|
17
|
+
def name=(value)
|
18
|
+
@attributes[:name] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# email - User email address
|
22
|
+
def email
|
23
|
+
@attributes[:email]
|
24
|
+
end
|
25
|
+
|
26
|
+
def email=(value)
|
27
|
+
@attributes[:email] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - Details of the user's request
|
31
|
+
def details
|
32
|
+
@attributes[:details]
|
33
|
+
end
|
34
|
+
|
35
|
+
def details=(value)
|
36
|
+
@attributes[:details] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete(params = {})
|
40
|
+
params ||= {}
|
41
|
+
params[:id] = @attributes[:id]
|
42
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
43
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
44
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
45
|
+
|
46
|
+
Api.send_request("/user_requests/#{@attributes[:id]}", :delete, params, @options)
|
47
|
+
end
|
48
|
+
|
49
|
+
def destroy(params = {})
|
50
|
+
delete(params)
|
51
|
+
end
|
52
|
+
|
53
|
+
def save
|
54
|
+
if @attributes[:id]
|
55
|
+
raise NotImplementedError.new("The UserRequest object doesn't support updates.")
|
56
|
+
else
|
57
|
+
new_obj = UserRequest.create(@attributes, @options)
|
58
|
+
@attributes = new_obj.attributes
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Parameters:
|
63
|
+
# page - int64 - Current page number.
|
64
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
65
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
66
|
+
def self.list(params = {}, options = {})
|
67
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
68
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
69
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
70
|
+
|
71
|
+
response, options = Api.send_request("/user_requests", :get, params, options)
|
72
|
+
response.data.map do |entity_data|
|
73
|
+
UserRequest.new(entity_data, options)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.all(params = {}, options = {})
|
78
|
+
list(params, options)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Parameters:
|
82
|
+
# id (required) - int64 - User Request ID.
|
83
|
+
def self.find(id, params = {}, options = {})
|
84
|
+
params ||= {}
|
85
|
+
params[:id] = id
|
86
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
87
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
88
|
+
|
89
|
+
response, options = Api.send_request("/user_requests/#{params[:id]}", :get, params, options)
|
90
|
+
UserRequest.new(response.data, options)
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.get(id, params = {}, options = {})
|
94
|
+
find(id, params, options)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Parameters:
|
98
|
+
# name (required) - string - Name of user requested
|
99
|
+
# email (required) - string - Email of user requested
|
100
|
+
# details (required) - string - Details of the user request
|
101
|
+
def self.create(params = {}, options = {})
|
102
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
103
|
+
raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String)
|
104
|
+
raise InvalidParameterError.new("Bad parameter: details must be an String") if params.dig(:details) and !params.dig(:details).is_a?(String)
|
105
|
+
raise MissingParameterError.new("Parameter missing: name") unless params.dig(:name)
|
106
|
+
raise MissingParameterError.new("Parameter missing: email") unless params.dig(:email)
|
107
|
+
raise MissingParameterError.new("Parameter missing: details") unless params.dig(:details)
|
108
|
+
|
109
|
+
response, options = Api.send_request("/user_requests", :post, params, options)
|
110
|
+
UserRequest.new(response.data, options)
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.delete(id, params = {}, options = {})
|
114
|
+
params ||= {}
|
115
|
+
params[:id] = id
|
116
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
117
|
+
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
118
|
+
|
119
|
+
response, _options = Api.send_request("/user_requests/#{params[:id]}", :delete, params, options)
|
120
|
+
response.data
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.destroy(id, params = {}, options = {})
|
124
|
+
delete(id, params, options)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
data/spec/list_spec.rb
CHANGED
@@ -12,15 +12,34 @@ RSpec.describe Files::List do
|
|
12
12
|
let(:per_page) { 3 }
|
13
13
|
|
14
14
|
context "when response includes a cursor" do
|
15
|
-
let(:client) { instance_double(Files::ApiClient
|
15
|
+
let(:client) { instance_double(Files::ApiClient) }
|
16
|
+
let(:stubbed_cursors) {
|
17
|
+
[
|
18
|
+
'3',
|
19
|
+
'6',
|
20
|
+
nil
|
21
|
+
]
|
22
|
+
}
|
23
|
+
|
24
|
+
before do
|
25
|
+
allow(client).to receive(:cursor).and_return(*stubbed_cursors)
|
26
|
+
end
|
16
27
|
|
17
28
|
it "does not call the API until out of responses" do
|
18
29
|
server_results = ('a'..'h').to_a
|
19
30
|
times_block_yielded = 0
|
31
|
+
request_cursor = nil
|
32
|
+
response_cursor = nil
|
33
|
+
|
20
34
|
list = described_class.new(ResourceWrapper, params) {
|
21
35
|
times_block_yielded += 1
|
36
|
+
request_cursor = params[:cursor]
|
37
|
+
range_start = params[:cursor] ? params[:cursor].to_i : 0
|
38
|
+
|
39
|
+
response_data = server_results[range_start, per_page]
|
40
|
+
response_cursor = (range_start + per_page).to_s
|
22
41
|
[
|
23
|
-
instance_double(Files::Response, data:
|
42
|
+
instance_double(Files::Response, data: response_data, http_status: 200, http_headers: { "x-files-cursor" => response_cursor }),
|
24
43
|
options
|
25
44
|
]
|
26
45
|
}
|
@@ -29,15 +48,18 @@ RSpec.describe Files::List do
|
|
29
48
|
expect(times_block_yielded).to eq(0)
|
30
49
|
expect(results.next.object).to eq('a')
|
31
50
|
expect(times_block_yielded).to eq(1)
|
51
|
+
expect(request_cursor).to eq(nil)
|
32
52
|
expect(results.next.object).to eq('b')
|
33
53
|
expect(results.next.object).to eq('c')
|
34
54
|
expect(results.next.object).to eq('d')
|
35
55
|
expect(times_block_yielded).to eq(2)
|
56
|
+
expect(request_cursor).to eq("3")
|
36
57
|
expect(results.next.object).to eq('e')
|
37
58
|
expect(results.next.object).to eq('f')
|
38
59
|
expect(results.next.object).to eq('g')
|
39
60
|
expect(results.next.object).to eq('h')
|
40
61
|
expect(times_block_yielded).to eq(3)
|
62
|
+
expect(request_cursor).to eq("6")
|
41
63
|
end
|
42
64
|
|
43
65
|
it "stops calling the API once there is an error" do
|
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.80
|
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-06
|
11
|
+
date: 2020-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- docs/automation.md
|
93
93
|
- docs/behavior.md
|
94
94
|
- docs/bundle.md
|
95
|
+
- docs/bundle_download.md
|
95
96
|
- docs/clickwrap.md
|
96
97
|
- docs/dns_record.md
|
97
98
|
- docs/errors.md
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- docs/usage_snapshot.md
|
134
135
|
- docs/user.md
|
135
136
|
- docs/user_cipher_use.md
|
137
|
+
- docs/user_request.md
|
136
138
|
- files.com.gemspec
|
137
139
|
- lib/files.com.rb
|
138
140
|
- lib/files.com/api.rb
|
@@ -147,6 +149,7 @@ files:
|
|
147
149
|
- lib/files.com/models/automation.rb
|
148
150
|
- lib/files.com/models/behavior.rb
|
149
151
|
- lib/files.com/models/bundle.rb
|
152
|
+
- lib/files.com/models/bundle_download.rb
|
150
153
|
- lib/files.com/models/clickwrap.rb
|
151
154
|
- lib/files.com/models/dir.rb
|
152
155
|
- lib/files.com/models/dns_record.rb
|
@@ -189,6 +192,7 @@ files:
|
|
189
192
|
- lib/files.com/models/usage_snapshot.rb
|
190
193
|
- lib/files.com/models/user.rb
|
191
194
|
- lib/files.com/models/user_cipher_use.rb
|
195
|
+
- lib/files.com/models/user_request.rb
|
192
196
|
- lib/files.com/response.rb
|
193
197
|
- lib/files.com/sizable_io.rb
|
194
198
|
- lib/files.com/system_profiler.rb
|