files.com 1.0.129 → 1.0.134
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/automation.md +24 -8
- data/docs/bundle_recipient.md +30 -0
- data/docs/form_field_set.md +1 -1
- data/docs/inbox_recipient.md +76 -0
- data/docs/status.md +6 -2
- data/lib/files.com.rb +1 -0
- data/lib/files.com/api_client.rb +1 -1
- data/lib/files.com/models/automation.rb +34 -4
- data/lib/files.com/models/bundle_recipient.rb +78 -0
- data/lib/files.com/models/inbox_recipient.rb +150 -0
- data/lib/files.com/models/status.rb +11 -1
- data/lib/files.com/uri.rb +5 -11
- data/spec/uri_spec.rb +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d09ff92ef54d2ff2b07c7677e9998262d07534c2f1970fec953066b6c646f769
|
4
|
+
data.tar.gz: 11d4e18d9ab273f09c9170dd6e12dc8ca5b55c17914df0764681c884d6a3fbc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f40491abab773ec451d0a880b4870a1bcb9796e4b5ee67c5fa2481cc0cfd10855c12d6bd460736541271b4a70300809caf10f4fb1d8f229236025a21ee0de6b
|
7
|
+
data.tar.gz: c0d39193c030c2004a0f2859142322ece43bec229aea4fcf6b47f05a998242aa055044ef78ded5da996e689f9c3f76e2459dbdb92f08fd39c93ee8025972e3e2
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.134
|
data/docs/automation.md
CHANGED
@@ -35,13 +35,15 @@
|
|
35
35
|
1,
|
36
36
|
2
|
37
37
|
],
|
38
|
-
"webhook_url": "https://app.files.com/api/webhooks/abc123"
|
38
|
+
"webhook_url": "https://app.files.com/api/webhooks/abc123",
|
39
|
+
"trigger_actions": "[ \"create\" ]",
|
40
|
+
"trigger_action_path": "path/to/file/or/folder"
|
39
41
|
}
|
40
42
|
```
|
41
43
|
|
42
44
|
* `id` (int64): Automation ID
|
43
45
|
* `automation` (string): Automation type
|
44
|
-
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
46
|
+
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
45
47
|
* `interval` (string): If trigger is `daily`, this specifies how often to run this automation. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
46
48
|
* `next_process_on` (string): If trigger is `daily`, date this automation will next run.
|
47
49
|
* `schedule` (object): If trigger is `custom_schedule`, Custom schedule description for when the automation should be run.
|
@@ -54,6 +56,8 @@
|
|
54
56
|
* `user_ids` (array): IDs of Users for the Automation (i.e. who to Request File from)
|
55
57
|
* `group_ids` (array): IDs of Groups for the Automation (i.e. who to Request File from)
|
56
58
|
* `webhook_url` (string): If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
|
59
|
+
* `trigger_actions` (string): If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
60
|
+
* `trigger_action_path` (string): If trigger is `action`, this is the path to watch for the specified trigger actions.
|
57
61
|
|
58
62
|
|
59
63
|
---
|
@@ -107,7 +111,9 @@ Files::Automation.create(
|
|
107
111
|
user_ids: [1,2],
|
108
112
|
group_ids: [1,2],
|
109
113
|
schedule: "{\"days_of_week\": [ 0, 1, 3 ], \"times_of_day\": [ \"7:30\", \"11:30\" ], \"time_zone\": \"Eastern Time (US & Canada)\"}",
|
110
|
-
trigger: "realtime"
|
114
|
+
trigger: "realtime",
|
115
|
+
trigger_actions: "[ \"create\" ]",
|
116
|
+
trigger_action_path: "path/to/file/or/folder"
|
111
117
|
)
|
112
118
|
```
|
113
119
|
|
@@ -123,7 +129,9 @@ Files::Automation.create(
|
|
123
129
|
* `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
124
130
|
* `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
125
131
|
* `schedule` (object): Custom schedule for running this automation.
|
126
|
-
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
132
|
+
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
133
|
+
* `trigger_actions` (array(string)): If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
134
|
+
* `trigger_action_path` (string): If trigger is `action`, this is the path to watch for the specified trigger actions.
|
127
135
|
|
128
136
|
|
129
137
|
---
|
@@ -139,7 +147,9 @@ Files::Automation.update(id,
|
|
139
147
|
user_ids: [1,2],
|
140
148
|
group_ids: [1,2],
|
141
149
|
schedule: "{\"days_of_week\": [ 0, 1, 3 ], \"times_of_day\": [ \"7:30\", \"11:30\" ], \"time_zone\": \"Eastern Time (US & Canada)\"}",
|
142
|
-
trigger: "realtime"
|
150
|
+
trigger: "realtime",
|
151
|
+
trigger_actions: "[ \"create\" ]",
|
152
|
+
trigger_action_path: "path/to/file/or/folder"
|
143
153
|
)
|
144
154
|
```
|
145
155
|
|
@@ -156,7 +166,9 @@ Files::Automation.update(id,
|
|
156
166
|
* `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
157
167
|
* `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
158
168
|
* `schedule` (object): Custom schedule for running this automation.
|
159
|
-
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
169
|
+
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
170
|
+
* `trigger_actions` (array(string)): If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
171
|
+
* `trigger_action_path` (string): If trigger is `action`, this is the path to watch for the specified trigger actions.
|
160
172
|
|
161
173
|
|
162
174
|
---
|
@@ -187,7 +199,9 @@ automation.update(
|
|
187
199
|
user_ids: [1,2],
|
188
200
|
group_ids: [1,2],
|
189
201
|
schedule: "{\"days_of_week\": [ 0, 1, 3 ], \"times_of_day\": [ \"7:30\", \"11:30\" ], \"time_zone\": \"Eastern Time (US & Canada)\"}",
|
190
|
-
trigger: "realtime"
|
202
|
+
trigger: "realtime",
|
203
|
+
trigger_actions: "[ \"create\" ]",
|
204
|
+
trigger_action_path: "path/to/file/or/folder"
|
191
205
|
)
|
192
206
|
```
|
193
207
|
|
@@ -204,7 +218,9 @@ automation.update(
|
|
204
218
|
* `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
205
219
|
* `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
206
220
|
* `schedule` (object): Custom schedule for running this automation.
|
207
|
-
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
221
|
+
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
222
|
+
* `trigger_actions` (array(string)): If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
223
|
+
* `trigger_action_path` (string): If trigger is `action`, this is the path to watch for the specified trigger actions.
|
208
224
|
|
209
225
|
|
210
226
|
---
|
data/docs/bundle_recipient.md
CHANGED
@@ -17,6 +17,9 @@
|
|
17
17
|
* `note` (string): A note sent to the recipient with the bundle.
|
18
18
|
* `recipient` (string): The recipient's email address.
|
19
19
|
* `sent_at` (date-time): When the Bundle was shared with this recipient.
|
20
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
21
|
+
* `bundle_id` (int64): Bundle to share.
|
22
|
+
* `share_after_create` (boolean): Set to true to share the link with the recipient upon creation.
|
20
23
|
|
21
24
|
|
22
25
|
---
|
@@ -44,3 +47,30 @@ Files::BundleRecipient.list(
|
|
44
47
|
* `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `has_registrations`.
|
45
48
|
* `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `has_registrations`.
|
46
49
|
* `bundle_id` (int64): Required - List recipients for the bundle with this ID.
|
50
|
+
|
51
|
+
|
52
|
+
---
|
53
|
+
|
54
|
+
## Create Bundle Recipient
|
55
|
+
|
56
|
+
```
|
57
|
+
Files::BundleRecipient.create(
|
58
|
+
user_id: 1,
|
59
|
+
bundle_id: 1,
|
60
|
+
recipient: "johndoe@gmail.com",
|
61
|
+
name: "John Smith",
|
62
|
+
company: "Acme Ltd",
|
63
|
+
note: "Just a note.",
|
64
|
+
share_after_create: true
|
65
|
+
)
|
66
|
+
```
|
67
|
+
|
68
|
+
### Parameters
|
69
|
+
|
70
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
71
|
+
* `bundle_id` (int64): Required - Bundle to share.
|
72
|
+
* `recipient` (string): Required - Email addresses to share this bundle with.
|
73
|
+
* `name` (string): Name of recipient.
|
74
|
+
* `company` (string): Company of recipient.
|
75
|
+
* `note` (string): Note to include in email.
|
76
|
+
* `share_after_create` (boolean): Set to true to share the link with the recipient upon creation.
|
data/docs/form_field_set.md
CHANGED
@@ -77,7 +77,7 @@ Files::FormFieldSet.find(id)
|
|
77
77
|
Files::FormFieldSet.create(
|
78
78
|
user_id: 1,
|
79
79
|
title: "Sample Form Title",
|
80
|
-
form_fields: [{"
|
80
|
+
form_fields: [{"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]
|
81
81
|
)
|
82
82
|
```
|
83
83
|
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# InboxRecipient
|
2
|
+
|
3
|
+
## Example InboxRecipient Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"company": "Acme Inc.",
|
8
|
+
"name": "John Doe",
|
9
|
+
"note": "Some note.",
|
10
|
+
"recipient": "john.doe@example.com",
|
11
|
+
"sent_at": "2000-01-01T01:00:00Z"
|
12
|
+
}
|
13
|
+
```
|
14
|
+
|
15
|
+
* `company` (string): The recipient's company.
|
16
|
+
* `name` (string): The recipient's name.
|
17
|
+
* `note` (string): A note sent to the recipient with the inbox.
|
18
|
+
* `recipient` (string): The recipient's email address.
|
19
|
+
* `sent_at` (date-time): When the Inbox was shared with this recipient.
|
20
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
21
|
+
* `inbox_id` (int64): Inbox to share.
|
22
|
+
* `share_after_create` (boolean): Set to true to share the link with the recipient upon creation.
|
23
|
+
|
24
|
+
|
25
|
+
---
|
26
|
+
|
27
|
+
## List Inbox Recipients
|
28
|
+
|
29
|
+
```
|
30
|
+
Files::InboxRecipient.list(
|
31
|
+
user_id: 1,
|
32
|
+
per_page: 1,
|
33
|
+
inbox_id: 1
|
34
|
+
)
|
35
|
+
```
|
36
|
+
|
37
|
+
### Parameters
|
38
|
+
|
39
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
40
|
+
* `cursor` (string): Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
41
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
42
|
+
* `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `has_registrations`.
|
43
|
+
* `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `has_registrations`.
|
44
|
+
* `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `has_registrations`.
|
45
|
+
* `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `has_registrations`.
|
46
|
+
* `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `has_registrations`.
|
47
|
+
* `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `has_registrations`.
|
48
|
+
* `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `has_registrations`.
|
49
|
+
* `inbox_id` (int64): Required - List recipients for the inbox with this ID.
|
50
|
+
|
51
|
+
|
52
|
+
---
|
53
|
+
|
54
|
+
## Create Inbox Recipient
|
55
|
+
|
56
|
+
```
|
57
|
+
Files::InboxRecipient.create(
|
58
|
+
user_id: 1,
|
59
|
+
inbox_id: 1,
|
60
|
+
recipient: "johndoe@gmail.com",
|
61
|
+
name: "John Smith",
|
62
|
+
company: "Acme Ltd",
|
63
|
+
note: "Just a note.",
|
64
|
+
share_after_create: true
|
65
|
+
)
|
66
|
+
```
|
67
|
+
|
68
|
+
### Parameters
|
69
|
+
|
70
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
71
|
+
* `inbox_id` (int64): Required - Inbox to share.
|
72
|
+
* `recipient` (string): Required - Email addresses to share this inbox with.
|
73
|
+
* `name` (string): Name of recipient.
|
74
|
+
* `company` (string): Company of recipient.
|
75
|
+
* `note` (string): Note to include in email.
|
76
|
+
* `share_after_create` (boolean): Set to true to share the link with the recipient upon creation.
|
data/docs/status.md
CHANGED
@@ -17,12 +17,16 @@
|
|
17
17
|
|
18
18
|
]
|
19
19
|
}
|
20
|
-
]
|
20
|
+
],
|
21
|
+
"clickwrap_id": 1,
|
22
|
+
"clickwrap_body": ""
|
21
23
|
}
|
22
24
|
```
|
23
25
|
|
24
|
-
* `code` (int64): Status
|
26
|
+
* `code` (int64): Status HTTP code
|
25
27
|
* `message` (string): Error message
|
26
28
|
* `status` (string): Status message
|
27
29
|
* `data`: Additional data
|
28
30
|
* `errors` (array): A list of api errors
|
31
|
+
* `clickwrap_id` (int64): Required Clickwrap id
|
32
|
+
* `clickwrap_body` (string): Required Clickwrap body
|
data/lib/files.com.rb
CHANGED
@@ -58,6 +58,7 @@ require "files.com/models/history"
|
|
58
58
|
require "files.com/models/history_export"
|
59
59
|
require "files.com/models/history_export_result"
|
60
60
|
require "files.com/models/image"
|
61
|
+
require "files.com/models/inbox_recipient"
|
61
62
|
require "files.com/models/inbox_registration"
|
62
63
|
require "files.com/models/inbox_upload"
|
63
64
|
require "files.com/models/invoice"
|
data/lib/files.com/api_client.rb
CHANGED
@@ -27,7 +27,7 @@ module Files
|
|
27
27
|
@attributes[:automation] = value
|
28
28
|
end
|
29
29
|
|
30
|
-
# string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
30
|
+
# string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
31
31
|
def trigger
|
32
32
|
@attributes[:trigger]
|
33
33
|
end
|
@@ -144,6 +144,24 @@ module Files
|
|
144
144
|
@attributes[:webhook_url] = value
|
145
145
|
end
|
146
146
|
|
147
|
+
# string - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
148
|
+
def trigger_actions
|
149
|
+
@attributes[:trigger_actions]
|
150
|
+
end
|
151
|
+
|
152
|
+
def trigger_actions=(value)
|
153
|
+
@attributes[:trigger_actions] = value
|
154
|
+
end
|
155
|
+
|
156
|
+
# string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
157
|
+
def trigger_action_path
|
158
|
+
@attributes[:trigger_action_path]
|
159
|
+
end
|
160
|
+
|
161
|
+
def trigger_action_path=(value)
|
162
|
+
@attributes[:trigger_action_path] = value
|
163
|
+
end
|
164
|
+
|
147
165
|
# Parameters:
|
148
166
|
# automation (required) - string - Automation type
|
149
167
|
# source - string - Source Path
|
@@ -155,7 +173,9 @@ module Files
|
|
155
173
|
# user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
156
174
|
# group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
157
175
|
# schedule - object - Custom schedule for running this automation.
|
158
|
-
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
176
|
+
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
177
|
+
# trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
178
|
+
# trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
159
179
|
def update(params = {})
|
160
180
|
params ||= {}
|
161
181
|
params[:id] = @attributes[:id]
|
@@ -171,6 +191,8 @@ module Files
|
|
171
191
|
raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if params.dig(:user_ids) and !params.dig(:user_ids).is_a?(String)
|
172
192
|
raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
|
173
193
|
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params.dig(:trigger) and !params.dig(:trigger).is_a?(String)
|
194
|
+
raise InvalidParameterError.new("Bad parameter: trigger_actions must be an Array") if params.dig(:trigger_actions) and !params.dig(:trigger_actions).is_a?(Array)
|
195
|
+
raise InvalidParameterError.new("Bad parameter: trigger_action_path must be an String") if params.dig(:trigger_action_path) and !params.dig(:trigger_action_path).is_a?(String)
|
174
196
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
175
197
|
raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
|
176
198
|
|
@@ -259,7 +281,9 @@ module Files
|
|
259
281
|
# user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
260
282
|
# group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
261
283
|
# schedule - object - Custom schedule for running this automation.
|
262
|
-
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
284
|
+
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
285
|
+
# trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
286
|
+
# trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
263
287
|
def self.create(params = {}, options = {})
|
264
288
|
raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
|
265
289
|
raise InvalidParameterError.new("Bad parameter: source must be an String") if params.dig(:source) and !params.dig(:source).is_a?(String)
|
@@ -272,6 +296,8 @@ module Files
|
|
272
296
|
raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
|
273
297
|
raise InvalidParameterError.new("Bad parameter: schedule must be an Hash") if params.dig(:schedule) and !params.dig(:schedule).is_a?(Hash)
|
274
298
|
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params.dig(:trigger) and !params.dig(:trigger).is_a?(String)
|
299
|
+
raise InvalidParameterError.new("Bad parameter: trigger_actions must be an Array") if params.dig(:trigger_actions) and !params.dig(:trigger_actions).is_a?(Array)
|
300
|
+
raise InvalidParameterError.new("Bad parameter: trigger_action_path must be an String") if params.dig(:trigger_action_path) and !params.dig(:trigger_action_path).is_a?(String)
|
275
301
|
raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
|
276
302
|
|
277
303
|
response, options = Api.send_request("/automations", :post, params, options)
|
@@ -289,7 +315,9 @@ module Files
|
|
289
315
|
# user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
290
316
|
# group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
291
317
|
# schedule - object - Custom schedule for running this automation.
|
292
|
-
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, or `
|
318
|
+
# trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
319
|
+
# trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
320
|
+
# trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
293
321
|
def self.update(id, params = {}, options = {})
|
294
322
|
params ||= {}
|
295
323
|
params[:id] = id
|
@@ -305,6 +333,8 @@ module Files
|
|
305
333
|
raise InvalidParameterError.new("Bad parameter: group_ids must be an String") if params.dig(:group_ids) and !params.dig(:group_ids).is_a?(String)
|
306
334
|
raise InvalidParameterError.new("Bad parameter: schedule must be an Hash") if params.dig(:schedule) and !params.dig(:schedule).is_a?(Hash)
|
307
335
|
raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params.dig(:trigger) and !params.dig(:trigger).is_a?(String)
|
336
|
+
raise InvalidParameterError.new("Bad parameter: trigger_actions must be an Array") if params.dig(:trigger_actions) and !params.dig(:trigger_actions).is_a?(Array)
|
337
|
+
raise InvalidParameterError.new("Bad parameter: trigger_action_path must be an String") if params.dig(:trigger_action_path) and !params.dig(:trigger_action_path).is_a?(String)
|
308
338
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
309
339
|
raise MissingParameterError.new("Parameter missing: automation") unless params.dig(:automation)
|
310
340
|
|
@@ -14,26 +14,82 @@ module Files
|
|
14
14
|
@attributes[:company]
|
15
15
|
end
|
16
16
|
|
17
|
+
def company=(value)
|
18
|
+
@attributes[:company] = value
|
19
|
+
end
|
20
|
+
|
17
21
|
# string - The recipient's name.
|
18
22
|
def name
|
19
23
|
@attributes[:name]
|
20
24
|
end
|
21
25
|
|
26
|
+
def name=(value)
|
27
|
+
@attributes[:name] = value
|
28
|
+
end
|
29
|
+
|
22
30
|
# string - A note sent to the recipient with the bundle.
|
23
31
|
def note
|
24
32
|
@attributes[:note]
|
25
33
|
end
|
26
34
|
|
35
|
+
def note=(value)
|
36
|
+
@attributes[:note] = value
|
37
|
+
end
|
38
|
+
|
27
39
|
# string - The recipient's email address.
|
28
40
|
def recipient
|
29
41
|
@attributes[:recipient]
|
30
42
|
end
|
31
43
|
|
44
|
+
def recipient=(value)
|
45
|
+
@attributes[:recipient] = value
|
46
|
+
end
|
47
|
+
|
32
48
|
# date-time - When the Bundle was shared with this recipient.
|
33
49
|
def sent_at
|
34
50
|
@attributes[:sent_at]
|
35
51
|
end
|
36
52
|
|
53
|
+
def sent_at=(value)
|
54
|
+
@attributes[:sent_at] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# int64 - User ID. Provide a value of `0` to operate the current session's user.
|
58
|
+
def user_id
|
59
|
+
@attributes[:user_id]
|
60
|
+
end
|
61
|
+
|
62
|
+
def user_id=(value)
|
63
|
+
@attributes[:user_id] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# int64 - Bundle to share.
|
67
|
+
def bundle_id
|
68
|
+
@attributes[:bundle_id]
|
69
|
+
end
|
70
|
+
|
71
|
+
def bundle_id=(value)
|
72
|
+
@attributes[:bundle_id] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# boolean - Set to true to share the link with the recipient upon creation.
|
76
|
+
def share_after_create
|
77
|
+
@attributes[:share_after_create]
|
78
|
+
end
|
79
|
+
|
80
|
+
def share_after_create=(value)
|
81
|
+
@attributes[:share_after_create] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
def save
|
85
|
+
if @attributes[:id]
|
86
|
+
raise NotImplementedError.new("The BundleRecipient object doesn't support updates.")
|
87
|
+
else
|
88
|
+
new_obj = BundleRecipient.create(@attributes, @options)
|
89
|
+
@attributes = new_obj.attributes
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
37
93
|
# Parameters:
|
38
94
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
39
95
|
# cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
@@ -68,5 +124,27 @@ module Files
|
|
68
124
|
def self.all(params = {}, options = {})
|
69
125
|
list(params, options)
|
70
126
|
end
|
127
|
+
|
128
|
+
# Parameters:
|
129
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
130
|
+
# bundle_id (required) - int64 - Bundle to share.
|
131
|
+
# recipient (required) - string - Email addresses to share this bundle with.
|
132
|
+
# name - string - Name of recipient.
|
133
|
+
# company - string - Company of recipient.
|
134
|
+
# note - string - Note to include in email.
|
135
|
+
# share_after_create - boolean - Set to true to share the link with the recipient upon creation.
|
136
|
+
def self.create(params = {}, options = {})
|
137
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
138
|
+
raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params.dig(:bundle_id) and !params.dig(:bundle_id).is_a?(Integer)
|
139
|
+
raise InvalidParameterError.new("Bad parameter: recipient must be an String") if params.dig(:recipient) and !params.dig(:recipient).is_a?(String)
|
140
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
141
|
+
raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
|
142
|
+
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
143
|
+
raise MissingParameterError.new("Parameter missing: bundle_id") unless params.dig(:bundle_id)
|
144
|
+
raise MissingParameterError.new("Parameter missing: recipient") unless params.dig(:recipient)
|
145
|
+
|
146
|
+
response, options = Api.send_request("/bundle_recipients", :post, params, options)
|
147
|
+
BundleRecipient.new(response.data, options)
|
148
|
+
end
|
71
149
|
end
|
72
150
|
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class InboxRecipient
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# string - The recipient's company.
|
13
|
+
def company
|
14
|
+
@attributes[:company]
|
15
|
+
end
|
16
|
+
|
17
|
+
def company=(value)
|
18
|
+
@attributes[:company] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# string - The recipient's name.
|
22
|
+
def name
|
23
|
+
@attributes[:name]
|
24
|
+
end
|
25
|
+
|
26
|
+
def name=(value)
|
27
|
+
@attributes[:name] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - A note sent to the recipient with the inbox.
|
31
|
+
def note
|
32
|
+
@attributes[:note]
|
33
|
+
end
|
34
|
+
|
35
|
+
def note=(value)
|
36
|
+
@attributes[:note] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# string - The recipient's email address.
|
40
|
+
def recipient
|
41
|
+
@attributes[:recipient]
|
42
|
+
end
|
43
|
+
|
44
|
+
def recipient=(value)
|
45
|
+
@attributes[:recipient] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# date-time - When the Inbox was shared with this recipient.
|
49
|
+
def sent_at
|
50
|
+
@attributes[:sent_at]
|
51
|
+
end
|
52
|
+
|
53
|
+
def sent_at=(value)
|
54
|
+
@attributes[:sent_at] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# int64 - User ID. Provide a value of `0` to operate the current session's user.
|
58
|
+
def user_id
|
59
|
+
@attributes[:user_id]
|
60
|
+
end
|
61
|
+
|
62
|
+
def user_id=(value)
|
63
|
+
@attributes[:user_id] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# int64 - Inbox to share.
|
67
|
+
def inbox_id
|
68
|
+
@attributes[:inbox_id]
|
69
|
+
end
|
70
|
+
|
71
|
+
def inbox_id=(value)
|
72
|
+
@attributes[:inbox_id] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# boolean - Set to true to share the link with the recipient upon creation.
|
76
|
+
def share_after_create
|
77
|
+
@attributes[:share_after_create]
|
78
|
+
end
|
79
|
+
|
80
|
+
def share_after_create=(value)
|
81
|
+
@attributes[:share_after_create] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
def save
|
85
|
+
if @attributes[:id]
|
86
|
+
raise NotImplementedError.new("The InboxRecipient object doesn't support updates.")
|
87
|
+
else
|
88
|
+
new_obj = InboxRecipient.create(@attributes, @options)
|
89
|
+
@attributes = new_obj.attributes
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Parameters:
|
94
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
95
|
+
# cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
96
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
97
|
+
# sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `has_registrations`.
|
98
|
+
# filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `has_registrations`.
|
99
|
+
# filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `has_registrations`.
|
100
|
+
# filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `has_registrations`.
|
101
|
+
# filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `has_registrations`.
|
102
|
+
# filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `has_registrations`.
|
103
|
+
# filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `has_registrations`.
|
104
|
+
# inbox_id (required) - int64 - List recipients for the inbox with this ID.
|
105
|
+
def self.list(params = {}, options = {})
|
106
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
107
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
|
108
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
109
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
|
110
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
|
111
|
+
raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
|
112
|
+
raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
|
113
|
+
raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
|
114
|
+
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
|
115
|
+
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
|
116
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
117
|
+
raise MissingParameterError.new("Parameter missing: inbox_id") unless params.dig(:inbox_id)
|
118
|
+
|
119
|
+
List.new(InboxRecipient, params) do
|
120
|
+
Api.send_request("/inbox_recipients", :get, params, options)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def self.all(params = {}, options = {})
|
125
|
+
list(params, options)
|
126
|
+
end
|
127
|
+
|
128
|
+
# Parameters:
|
129
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
130
|
+
# inbox_id (required) - int64 - Inbox to share.
|
131
|
+
# recipient (required) - string - Email addresses to share this inbox with.
|
132
|
+
# name - string - Name of recipient.
|
133
|
+
# company - string - Company of recipient.
|
134
|
+
# note - string - Note to include in email.
|
135
|
+
# share_after_create - boolean - Set to true to share the link with the recipient upon creation.
|
136
|
+
def self.create(params = {}, options = {})
|
137
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
138
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
139
|
+
raise InvalidParameterError.new("Bad parameter: recipient must be an String") if params.dig(:recipient) and !params.dig(:recipient).is_a?(String)
|
140
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
|
141
|
+
raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
|
142
|
+
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
143
|
+
raise MissingParameterError.new("Parameter missing: inbox_id") unless params.dig(:inbox_id)
|
144
|
+
raise MissingParameterError.new("Parameter missing: recipient") unless params.dig(:recipient)
|
145
|
+
|
146
|
+
response, options = Api.send_request("/inbox_recipients", :post, params, options)
|
147
|
+
InboxRecipient.new(response.data, options)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -9,7 +9,7 @@ module Files
|
|
9
9
|
@options = options || {}
|
10
10
|
end
|
11
11
|
|
12
|
-
# int64 - Status
|
12
|
+
# int64 - Status HTTP code
|
13
13
|
def code
|
14
14
|
@attributes[:code]
|
15
15
|
end
|
@@ -33,5 +33,15 @@ module Files
|
|
33
33
|
def errors
|
34
34
|
@attributes[:errors]
|
35
35
|
end
|
36
|
+
|
37
|
+
# int64 - Required Clickwrap id
|
38
|
+
def clickwrap_id
|
39
|
+
@attributes[:clickwrap_id]
|
40
|
+
end
|
41
|
+
|
42
|
+
# string - Required Clickwrap body
|
43
|
+
def clickwrap_body
|
44
|
+
@attributes[:clickwrap_body]
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|
data/lib/files.com/uri.rb
CHANGED
@@ -34,17 +34,11 @@ module Files
|
|
34
34
|
# here we need to, so switch to ASCII.
|
35
35
|
component = component.dup
|
36
36
|
component.force_encoding(Encoding::ASCII_8BIT)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
character_class,
|
43
|
-
leave_encoded
|
44
|
-
)
|
45
|
-
rescue ArgumentError
|
46
|
-
encoded = encode_component(unencoded)
|
47
|
-
end
|
37
|
+
encoded = Addressable::URI.encode_component(
|
38
|
+
component,
|
39
|
+
character_class,
|
40
|
+
leave_encoded
|
41
|
+
)
|
48
42
|
encoded.force_encoding(Encoding::UTF_8)
|
49
43
|
encoded
|
50
44
|
end
|
data/spec/uri_spec.rb
CHANGED
@@ -2,10 +2,14 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Files::URI do
|
4
4
|
describe "normalized_path" do
|
5
|
-
it { expect(described_class.normalized_path("[[strange stuff]]#yes.text")).to eq("
|
5
|
+
it { expect(described_class.normalized_path("path/[[strange stuff]]#yes.text")).to eq("path/%5B%5Bstrange%20stuff%5D%5D%23yes.text") }
|
6
6
|
it { expect(Addressable::URI.unencode_component(described_class.normalized_path("[[strange stuff]]#yes.text"))).to eq("[[strange stuff]]#yes.text") }
|
7
7
|
|
8
8
|
it { expect(described_class.normalized_path("folder/AdÇe")).to eq("folder/AdC%CC%A7e") }
|
9
9
|
it { expect(Addressable::URI.unencode_component(described_class.normalized_path("AdÇe"))).to eq("AdÇe") }
|
10
|
+
|
11
|
+
it { expect(described_class.normalized_path("lorem%20ipsum.txt")).to eq("lorem%2520ipsum.txt") }
|
12
|
+
it { expect(described_class.normalized_path("lorem%ipsum.txt")).to eq("lorem%25ipsum.txt") }
|
13
|
+
it { expect(described_class.normalized_path("lorem ipsum.txt")).to eq("lorem%20ipsum.txt") }
|
10
14
|
end
|
11
15
|
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.
|
4
|
+
version: 1.0.134
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- docs/history_export.md
|
118
118
|
- docs/history_export_result.md
|
119
119
|
- docs/image.md
|
120
|
+
- docs/inbox_recipient.md
|
120
121
|
- docs/inbox_registration.md
|
121
122
|
- docs/inbox_upload.md
|
122
123
|
- docs/invoice.md
|
@@ -187,6 +188,7 @@ files:
|
|
187
188
|
- lib/files.com/models/history_export.rb
|
188
189
|
- lib/files.com/models/history_export_result.rb
|
189
190
|
- lib/files.com/models/image.rb
|
191
|
+
- lib/files.com/models/inbox_recipient.rb
|
190
192
|
- lib/files.com/models/inbox_registration.rb
|
191
193
|
- lib/files.com/models/inbox_upload.rb
|
192
194
|
- lib/files.com/models/invoice.rb
|