files.com 1.0.78 → 1.0.83

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: 0a980877cfd1d13cd77d84319021702c5caa7bf8f74505756bf56bafce53aaad
4
- data.tar.gz: 35bd639b7ccfa518f7f82ac6d78e602469b912d3410ac0eaea9a9eec7b412453
3
+ metadata.gz: 006441fb28a84982b4ee2960d7dac9521bc3da4cf322f94384d52d290364e05a
4
+ data.tar.gz: f12f3f8953ba55bdc5e34cdd2729804385ea860a761e88ee8e88a0a30fa4e881
5
5
  SHA512:
6
- metadata.gz: 13e0d73c07f2664595c085a427ef1f6f29b86aec412d7229f07b4d2db91db5e750372c14a4e4e00f9dfd64e0d6478ca5903c2f45f859072bf08c40bed791be9a
7
- data.tar.gz: a367d3a24b1d1c9edccd8e30dfffc65fd786edf9e5a799ec97456b1d503ec908bb44c8e87d23ef3119e213b101ca05dcaeba08146d0102d0087b8bf3307482a4
6
+ metadata.gz: f9b2cef26cd02577de07509902c20690a0308425756c4c65630aee0580002ef6ec4ea7ed56055657f8c9172bdcba61fa2197ad173cd207f5641f8e34b44db18c
7
+ data.tar.gz: 37fefaa5025389fae566ffeb3fce600102b5e1793f9bf1e3f63e6c05ef9c6a8ba42ba7ad9cd39e6a7eec457a4421161985421e83716d90299b7a6d7a6a6d81b6
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.78
1
+ 1.0.83
@@ -107,7 +107,8 @@ Files::Behavior.webhook_test(
107
107
  method: "GET",
108
108
  encoding: "RAW",
109
109
  headers: "x-test-header => testvalue",
110
- body: "test-param => testvalue"
110
+ body: "test-param => testvalue",
111
+ action: "test"
111
112
  )
112
113
  ```
113
114
 
@@ -118,6 +119,7 @@ Files::Behavior.webhook_test(
118
119
  * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data).
119
120
  * `headers` (object): Additional request headers.
120
121
  * `body` (object): Additional body parameters.
122
+ * `action` (string): action for test body
121
123
 
122
124
 
123
125
  ---
@@ -126,7 +128,8 @@ Files::Behavior.webhook_test(
126
128
 
127
129
  ```
128
130
  Files::Behavior.update(id,
129
- value: "{\"method\": \"GET\"}"
131
+ value: "{\"method\": \"GET\"}",
132
+ behavior: "webhook"
130
133
  )
131
134
  ```
132
135
 
@@ -135,6 +138,8 @@ Files::Behavior.update(id,
135
138
  * `id` (int64): Required - Behavior ID.
136
139
  * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
137
140
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
141
+ * `behavior` (string): Behavior type.
142
+ * `path` (string): Folder behaviors path.
138
143
 
139
144
 
140
145
  ---
@@ -158,7 +163,8 @@ Files::Behavior.delete(id)
158
163
  behavior = Files::Behavior.list_for(path).first
159
164
 
160
165
  behavior.update(
161
- value: "{\"method\": \"GET\"}"
166
+ value: "{\"method\": \"GET\"}",
167
+ behavior: "webhook"
162
168
  )
163
169
  ```
164
170
 
@@ -167,6 +173,8 @@ behavior.update(
167
173
  * `id` (int64): Required - Behavior ID.
168
174
  * `value` (string): The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
169
175
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
176
+ * `behavior` (string): Behavior type.
177
+ * `path` (string): Folder behaviors path.
170
178
 
171
179
 
172
180
  ---
@@ -72,6 +72,7 @@ Files::File.download(path,
72
72
  * `path` (string): Required - Path to operate on.
73
73
  * `action` (string): Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
74
74
  * `id` (int64): If provided, lookup the file by id instead of path.
75
+ * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
75
76
  * `with_previews` (boolean): Include file preview information?
76
77
  * `with_priority_color` (boolean): Include file priority color information?
77
78
 
@@ -164,6 +165,7 @@ file.download(
164
165
  * `path` (string): Required - Path to operate on.
165
166
  * `action` (string): Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
166
167
  * `id` (int64): If provided, lookup the file by id instead of path.
168
+ * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
167
169
  * `with_previews` (boolean): Include file preview information?
168
170
  * `with_priority_color` (boolean): Include file priority color information?
169
171
 
@@ -6,7 +6,8 @@
6
6
 
7
7
  ```
8
8
  Files::FileAction.copy(path,
9
- destination: "destination"
9
+ destination: "destination",
10
+ structure: true
10
11
  )
11
12
  ```
12
13
 
@@ -14,6 +15,7 @@ Files::FileAction.copy(path,
14
15
 
15
16
  * `path` (string): Required - Path to operate on.
16
17
  * `destination` (string): Required - Copy destination path.
18
+ * `structure` (boolean): Copy structure only?
17
19
 
18
20
 
19
21
  ---
@@ -66,7 +68,8 @@ Files::FileAction.begin_upload(path,
66
68
  file_action = Files::FileAction.list_for(path).first
67
69
 
68
70
  file_action.copy(
69
- destination: "destination"
71
+ destination: "destination",
72
+ structure: true
70
73
  )
71
74
  ```
72
75
 
@@ -74,6 +77,7 @@ file_action.copy(
74
77
 
75
78
  * `path` (string): Required - Path to operate on.
76
79
  * `destination` (string): Required - Copy destination path.
80
+ * `structure` (boolean): Copy structure only?
77
81
 
78
82
 
79
83
  ---
@@ -57,6 +57,7 @@ Files::Folder.list_for(path,
57
57
  page: 1,
58
58
  per_page: 1,
59
59
  search_all: true,
60
+ with_previews: true,
60
61
  with_priority_color: true
61
62
  )
62
63
  ```
@@ -72,6 +73,7 @@ Files::Folder.list_for(path,
72
73
  * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
73
74
  * `search` (string): If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
74
75
  * `search_all` (boolean): Search entire site?
76
+ * `with_previews` (boolean): Include file previews?
75
77
  * `with_priority_color` (boolean): Include file priority color information?
76
78
 
77
79
 
@@ -69,12 +69,17 @@ Files::GroupUser.update(id,
69
69
  ## Delete Group User
70
70
 
71
71
  ```
72
- Files::GroupUser.delete(id)
72
+ Files::GroupUser.delete(id,
73
+ group_id: 1,
74
+ user_id: 1
75
+ )
73
76
  ```
74
77
 
75
78
  ### Parameters
76
79
 
77
80
  * `id` (int64): Required - Group User ID.
81
+ * `group_id` (int64): Required - Group ID from which to remove user.
82
+ * `user_id` (int64): Required - User ID to remove from group.
78
83
 
79
84
 
80
85
  ---
@@ -106,9 +111,14 @@ group_user.update(
106
111
  ```
107
112
  group_user = Files::GroupUser.list_for(path).first
108
113
 
109
- group_user.delete
114
+ group_user.delete(
115
+ group_id: 1,
116
+ user_id: 1
117
+ )
110
118
  ```
111
119
 
112
120
  ### Parameters
113
121
 
114
122
  * `id` (int64): Required - Group User ID.
123
+ * `group_id` (int64): Required - Group ID from which to remove user.
124
+ * `user_id` (int64): Required - User ID to remove from group.
@@ -68,7 +68,7 @@ Files::Permission.create(path,
68
68
 
69
69
  * `group_id` (int64): Group ID
70
70
  * `path` (string): Folder path
71
- * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `previewonly`, or `history`
71
+ * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
72
72
  * `recursive` (boolean): Apply to subfolders recursively?
73
73
  * `user_id` (int64): User ID. Provide `username` or `user_id`
74
74
  * `username` (string): User username. Provide `username` or `user_id`
@@ -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": "personnel"
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 personnel or business_other account types
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: "personnel"
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 personnel or business_other account types
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: "personnel"
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 personnel or business_other account types
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: "personnel"
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 personnel or business_other account types
321
+ * `one_drive_account_type` (string): Either personal or business_other account types
322
322
 
323
323
 
324
324
  ---
@@ -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?
@@ -23,9 +23,7 @@
23
23
  "disabled": true,
24
24
  "email": "john.doe@files.com",
25
25
  "ftp_permission": true,
26
- "group_ids": [
27
-
28
- ],
26
+ "group_ids": "",
29
27
  "header_text": "User-specific message.",
30
28
  "language": "en",
31
29
  "last_login_at": "2000-01-01T01:00:00Z",
@@ -72,7 +70,7 @@
72
70
  * `disabled` (boolean): Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting.
73
71
  * `email` (email): User email address
74
72
  * `ftp_permission` (boolean): Can the user access with FTP/FTPS?
75
- * `group_ids` (array): Comma-separated list of group IDs of which this user is a member
73
+ * `group_ids` (string): Comma-separated list of group IDs of which this user is a member
76
74
  * `header_text` (string): Text to display to the user in the header of the UI
77
75
  * `language` (string): Preferred language
78
76
  * `last_login_at` (date-time): User's last login time
@@ -103,7 +101,7 @@
103
101
  * `avatar_delete` (boolean): If true, the avatar will be deleted.
104
102
  * `change_password` (string): Used for changing a password on an existing user.
105
103
  * `change_password_confirmation` (string): Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
106
- * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
104
+ * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
107
105
  * `group_id` (int64): Group ID to associate this user with.
108
106
  * `password` (string): User password.
109
107
  * `password_confirmation` (string): Optional, but if provided, we will ensure that it matches the value sent in `password`.
@@ -126,6 +124,7 @@ Files::User.list(
126
124
  * `page` (int64): Current page number.
127
125
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
128
126
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
127
+ * `ids` (string): comma-separated list of User IDs
129
128
  * `q[username]` (string): List users matching username.
130
129
  * `q[email]` (string): List users matching email.
131
130
  * `q[notes]` (string): List users matching notes field.
@@ -199,7 +198,7 @@ Files::User.create(
199
198
  * `change_password` (string): Used for changing a password on an existing user.
200
199
  * `change_password_confirmation` (string): Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
201
200
  * `email` (string): User's email.
202
- * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
201
+ * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
203
202
  * `group_id` (int64): Group ID to associate this user with.
204
203
  * `group_ids` (string): A list of group ids to associate this user with. Comma delimited.
205
204
  * `password` (string): User password.
@@ -324,7 +323,7 @@ Files::User.update(id,
324
323
  * `change_password` (string): Used for changing a password on an existing user.
325
324
  * `change_password_confirmation` (string): Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
326
325
  * `email` (string): User's email.
327
- * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
326
+ * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
328
327
  * `group_id` (int64): Group ID to associate this user with.
329
328
  * `group_ids` (string): A list of group ids to associate this user with. Comma delimited.
330
329
  * `password` (string): User password.
@@ -470,7 +469,7 @@ user.update(
470
469
  * `change_password` (string): Used for changing a password on an existing user.
471
470
  * `change_password_confirmation` (string): Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
472
471
  * `email` (string): User's email.
473
- * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
472
+ * `grant_permission` (string): Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
474
473
  * `group_id` (int64): Group ID to associate this user with.
475
474
  * `group_ids` (string): A list of group ids to associate this user with. Comma delimited.
476
475
  * `password` (string): User password.
@@ -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.
@@ -75,6 +75,7 @@ require "files.com/models/usage_daily_snapshot"
75
75
  require "files.com/models/usage_snapshot"
76
76
  require "files.com/models/user"
77
77
  require "files.com/models/user_cipher_use"
78
+ require "files.com/models/user_request"
78
79
 
79
80
  require "files.com/models/dir"
80
81
  require "files.com/models/file_utils"
@@ -66,12 +66,16 @@ module Files
66
66
  # Parameters:
67
67
  # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
68
68
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
69
+ # behavior - string - Behavior type.
70
+ # path - string - Folder behaviors path.
69
71
  def update(params = {})
70
72
  params ||= {}
71
73
  params[:id] = @attributes[:id]
72
74
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
73
75
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
74
76
  raise InvalidParameterError.new("Bad parameter: value must be an String") if params.dig(:value) and !params.dig(:value).is_a?(String)
77
+ raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
78
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
75
79
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
76
80
 
77
81
  Api.send_request("/behaviors/#{@attributes[:id]}", :patch, params, @options)
@@ -183,12 +187,14 @@ module Files
183
187
  # encoding - string - HTTP encoding method. Can be JSON, XML, or RAW (form data).
184
188
  # headers - object - Additional request headers.
185
189
  # body - object - Additional body parameters.
190
+ # action - string - action for test body
186
191
  def self.webhook_test(params = {}, options = {})
187
192
  raise InvalidParameterError.new("Bad parameter: url must be an String") if params.dig(:url) and !params.dig(:url).is_a?(String)
188
193
  raise InvalidParameterError.new("Bad parameter: method must be an String") if params.dig(:method) and !params.dig(:method).is_a?(String)
189
194
  raise InvalidParameterError.new("Bad parameter: encoding must be an String") if params.dig(:encoding) and !params.dig(:encoding).is_a?(String)
190
195
  raise InvalidParameterError.new("Bad parameter: headers must be an Hash") if params.dig(:headers) and !params.dig(:headers).is_a?(Hash)
191
196
  raise InvalidParameterError.new("Bad parameter: body must be an Hash") if params.dig(:body) and !params.dig(:body).is_a?(Hash)
197
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
192
198
  raise MissingParameterError.new("Parameter missing: url") unless params.dig(:url)
193
199
 
194
200
  response, _options = Api.send_request("/behaviors/webhook/test", :post, params, options)
@@ -198,12 +204,15 @@ module Files
198
204
  # Parameters:
199
205
  # value - string - The value of the folder behavior. Can be a integer, array, or hash depending on the type of folder behavior.
200
206
  # attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
207
+ # behavior - string - Behavior type.
208
+ # path - string - Folder behaviors path.
201
209
  def self.update(id, params = {}, options = {})
202
210
  params ||= {}
203
211
  params[:id] = id
204
212
  raise InvalidParameterError.new("Bad parameter: id must be one of String, Integer, Hash") if params.dig(:id) and [ String, Integer, Hash ].none? { |klass| params.dig(:id).is_a?(klass) }
205
213
  raise InvalidParameterError.new("Bad parameter: value must be an String") if params.dig(:value) and !params.dig(:value).is_a?(String)
206
- raise InvalidParameterError.new("Bad parameter: attachment_file must be one of String, Integer, Hash") if params.dig(:attachment_file) and [ String, Integer, Hash ].none? { |klass| params.dig(:attachment_file).is_a?(klass) }
214
+ raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
215
+ raise InvalidParameterError.new("Bad parameter: path must be one of String, Integer, Hash") if params.dig(:path) and [ String, Integer, Hash ].none? { |klass| params.dig(:path).is_a?(klass) }
207
216
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
208
217
 
209
218
  response, options = Api.send_request("/behaviors/#{params[:id]}", :patch, params, options)
@@ -827,6 +827,7 @@ module Files
827
827
  # Parameters:
828
828
  # action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
829
829
  # id - int64 - If provided, lookup the file by id instead of path.
830
+ # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
830
831
  # with_previews - boolean - Include file preview information?
831
832
  # with_priority_color - boolean - Include file priority color information?
832
833
  def download(params = {})
@@ -836,6 +837,7 @@ module Files
836
837
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
837
838
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
838
839
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
840
+ raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
839
841
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
840
842
 
841
843
  Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, @options)
@@ -886,6 +888,7 @@ module Files
886
888
  # Parameters:
887
889
  # action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
888
890
  # id - int64 - If provided, lookup the file by id instead of path.
891
+ # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
889
892
  # with_previews - boolean - Include file preview information?
890
893
  # with_priority_color - boolean - Include file priority color information?
891
894
  def self.download(path, params = {}, options = {})
@@ -894,6 +897,7 @@ module Files
894
897
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
895
898
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
896
899
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
900
+ raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params.dig(:preview_size) and !params.dig(:preview_size).is_a?(String)
897
901
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
898
902
 
899
903
  response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
@@ -13,6 +13,7 @@ module Files
13
13
  #
14
14
  # Parameters:
15
15
  # destination (required) - string - Copy destination path.
16
+ # structure - boolean - Copy structure only?
16
17
  def copy(params = {})
17
18
  params ||= {}
18
19
  params[:path] = @attributes[:path]
@@ -68,6 +69,7 @@ module Files
68
69
  #
69
70
  # Parameters:
70
71
  # destination (required) - string - Copy destination path.
72
+ # structure - boolean - Copy structure only?
71
73
  def self.copy(path, params = {}, options = {})
72
74
  params ||= {}
73
75
  params[:path] = path
@@ -322,6 +322,7 @@ module Files
322
322
  # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
323
323
  # search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
324
324
  # search_all - boolean - Search entire site?
325
+ # with_previews - boolean - Include file previews?
325
326
  # with_priority_color - boolean - Include file priority color information?
326
327
  def self.list_for(path, params = {}, options = {})
327
328
  params ||= {}
@@ -81,12 +81,19 @@ module Files
81
81
  Api.send_request("/group_users/#{@attributes[:id]}", :patch, params, @options)
82
82
  end
83
83
 
84
+ # Parameters:
85
+ # group_id (required) - int64 - Group ID from which to remove user.
86
+ # user_id (required) - int64 - User ID to remove from group.
84
87
  def delete(params = {})
85
88
  params ||= {}
86
89
  params[:id] = @attributes[:id]
87
90
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
88
91
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
92
+ raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
93
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
89
94
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
95
+ raise MissingParameterError.new("Parameter missing: group_id") unless params.dig(:group_id)
96
+ raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
90
97
 
91
98
  Api.send_request("/group_users/#{@attributes[:id]}", :delete, params, @options)
92
99
  end
@@ -140,11 +147,18 @@ module Files
140
147
  GroupUser.new(response.data, options)
141
148
  end
142
149
 
150
+ # Parameters:
151
+ # group_id (required) - int64 - Group ID from which to remove user.
152
+ # user_id (required) - int64 - User ID to remove from group.
143
153
  def self.delete(id, params = {}, options = {})
144
154
  params ||= {}
145
155
  params[:id] = id
146
156
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
157
+ raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
158
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
147
159
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
160
+ raise MissingParameterError.new("Parameter missing: group_id") unless params.dig(:group_id)
161
+ raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
148
162
 
149
163
  response, _options = Api.send_request("/group_users/#{params[:id]}", :delete, params, options)
150
164
  response.data
@@ -121,7 +121,7 @@ module Files
121
121
  # Parameters:
122
122
  # group_id - int64 - Group ID
123
123
  # path - string - Folder path
124
- # permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `previewonly`, or `history`
124
+ # permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
125
125
  # recursive - boolean - Apply to subfolders recursively?
126
126
  # user_id - int64 - User ID. Provide `username` or `user_id`
127
127
  # username - string - User username. Provide `username` or `user_id`
@@ -234,7 +234,7 @@ module Files
234
234
  @attributes[:auth_account_name] = value
235
235
  end
236
236
 
237
- # string - Either personnel or business_other account types
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 personnel or business_other account types
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 personnel or business_other account types
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 personnel or business_other account types
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?
@@ -158,7 +158,7 @@ module Files
158
158
  @attributes[:ftp_permission] = value
159
159
  end
160
160
 
161
- # array - Comma-separated list of group IDs of which this user is a member
161
+ # string - Comma-separated list of group IDs of which this user is a member
162
162
  def group_ids
163
163
  @attributes[:group_ids]
164
164
  end
@@ -437,7 +437,7 @@ module Files
437
437
  @attributes[:change_password_confirmation] = value
438
438
  end
439
439
 
440
- # string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
440
+ # string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
441
441
  def grant_permission
442
442
  @attributes[:grant_permission]
443
443
  end
@@ -521,7 +521,7 @@ module Files
521
521
  # change_password - string - Used for changing a password on an existing user.
522
522
  # change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
523
523
  # email - string - User's email.
524
- # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
524
+ # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
525
525
  # group_id - int64 - Group ID to associate this user with.
526
526
  # group_ids - string - A list of group ids to associate this user with. Comma delimited.
527
527
  # password - string - User password.
@@ -615,6 +615,7 @@ module Files
615
615
  # page - int64 - Current page number.
616
616
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
617
617
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
618
+ # ids - string - comma-separated list of User IDs
618
619
  # q[username] - string - List users matching username.
619
620
  # q[email] - string - List users matching email.
620
621
  # q[notes] - string - List users matching notes field.
@@ -629,6 +630,7 @@ module Files
629
630
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
630
631
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
631
632
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
633
+ raise InvalidParameterError.new("Bad parameter: ids must be an String") if params.dig(:ids) and !params.dig(:ids).is_a?(String)
632
634
  raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)
633
635
 
634
636
  response, options = Api.send_request("/users", :get, params, options)
@@ -663,7 +665,7 @@ module Files
663
665
  # change_password - string - Used for changing a password on an existing user.
664
666
  # change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
665
667
  # email - string - User's email.
666
- # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
668
+ # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
667
669
  # group_id - int64 - Group ID to associate this user with.
668
670
  # group_ids - string - A list of group ids to associate this user with. Comma delimited.
669
671
  # password - string - User password.
@@ -765,7 +767,7 @@ module Files
765
767
  # change_password - string - Used for changing a password on an existing user.
766
768
  # change_password_confirmation - string - Optional, but if provided, we will ensure that it matches the value sent in `change_password`.
767
769
  # email - string - User's email.
768
- # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `preview`, or `history`.
770
+ # grant_permission - string - Permission to grant on the user root. Can be blank or `full`, `read`, `write`, `list`, or `history`.
769
771
  # group_id - int64 - Group ID to associate this user with.
770
772
  # group_ids - string - A list of group ids to associate this user with. Comma delimited.
771
773
  # password - string - User password.
@@ -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
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.78
4
+ version: 1.0.83
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-07-02 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -134,6 +134,7 @@ files:
134
134
  - docs/usage_snapshot.md
135
135
  - docs/user.md
136
136
  - docs/user_cipher_use.md
137
+ - docs/user_request.md
137
138
  - files.com.gemspec
138
139
  - lib/files.com.rb
139
140
  - lib/files.com/api.rb
@@ -191,6 +192,7 @@ files:
191
192
  - lib/files.com/models/usage_snapshot.rb
192
193
  - lib/files.com/models/user.rb
193
194
  - lib/files.com/models/user_cipher_use.rb
195
+ - lib/files.com/models/user_request.rb
194
196
  - lib/files.com/response.rb
195
197
  - lib/files.com/sizable_io.rb
196
198
  - lib/files.com/system_profiler.rb