files.com 1.1.620 → 1.1.622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/event_channel.md +147 -0
- data/docs/event_delivery_attempt.md +68 -0
- data/docs/event_record.md +77 -0
- data/docs/event_subscription.md +188 -0
- data/docs/event_target.md +171 -0
- data/docs/external_event.md +3 -19
- data/docs/partner.md +24 -0
- data/docs/pending_work_event.md +60 -0
- data/docs/siem_http_destination_event.md +60 -0
- data/docs/site.md +8 -0
- data/docs/sso_event.md +73 -0
- data/docs/user.md +68 -4
- data/docs/user_lifecycle_rule.md +8 -0
- data/docs/user_security_event.md +58 -0
- data/lib/files.com/models/event_channel.rb +192 -0
- data/lib/files.com/models/event_delivery_attempt.rb +123 -0
- data/lib/files.com/models/event_record.rb +133 -0
- data/lib/files.com/models/event_subscription.rb +265 -0
- data/lib/files.com/models/event_target.rb +237 -0
- data/lib/files.com/models/external_event.rb +2 -74
- data/lib/files.com/models/partner.rb +42 -0
- data/lib/files.com/models/pending_work_event.rb +96 -0
- data/lib/files.com/models/siem_http_destination_event.rb +96 -0
- data/lib/files.com/models/sso_event.rb +128 -0
- data/lib/files.com/models/user.rb +100 -4
- data/lib/files.com/models/user_lifecycle_rule.rb +12 -0
- data/lib/files.com/models/user_security_event.rb +91 -0
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +9 -0
- metadata +20 -2
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Files
|
|
4
|
+
class EventSubscription
|
|
5
|
+
attr_reader :options, :attributes
|
|
6
|
+
|
|
7
|
+
def initialize(attributes = {}, options = {})
|
|
8
|
+
@attributes = attributes || {}
|
|
9
|
+
@options = options || {}
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# int64 - Event Subscription ID
|
|
13
|
+
def id
|
|
14
|
+
@attributes[:id]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def id=(value)
|
|
18
|
+
@attributes[:id] = value
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# int64 - Event Channel ID
|
|
22
|
+
def event_channel_id
|
|
23
|
+
@attributes[:event_channel_id]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def event_channel_id=(value)
|
|
27
|
+
@attributes[:event_channel_id] = value
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
31
|
+
def workspace_id
|
|
32
|
+
@attributes[:workspace_id]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def workspace_id=(value)
|
|
36
|
+
@attributes[:workspace_id] = value
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# boolean - If true, this default-workspace subscription applies to events from all workspaces.
|
|
40
|
+
def apply_to_all_workspaces
|
|
41
|
+
@attributes[:apply_to_all_workspaces]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def apply_to_all_workspaces=(value)
|
|
45
|
+
@attributes[:apply_to_all_workspaces] = value
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# string - Event Subscription name.
|
|
49
|
+
def name
|
|
50
|
+
@attributes[:name]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def name=(value)
|
|
54
|
+
@attributes[:name] = value
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# boolean - Whether this Event Subscription can dispatch events.
|
|
58
|
+
def enabled
|
|
59
|
+
@attributes[:enabled]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def enabled=(value)
|
|
63
|
+
@attributes[:enabled] = value
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# array(string) - Event type strings matched by this subscription. Blank means all event types.
|
|
67
|
+
def event_types
|
|
68
|
+
@attributes[:event_types]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def event_types=(value)
|
|
72
|
+
@attributes[:event_types] = value
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# object - Structured event payload filter.
|
|
76
|
+
def filter
|
|
77
|
+
@attributes[:filter]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def filter=(value)
|
|
81
|
+
@attributes[:filter] = value
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# object - Event Subscription delivery policy.
|
|
85
|
+
def delivery_policy
|
|
86
|
+
@attributes[:delivery_policy]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def delivery_policy=(value)
|
|
90
|
+
@attributes[:delivery_policy] = value
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# array(int64) - Event Target IDs this subscription sends to.
|
|
94
|
+
def event_target_ids
|
|
95
|
+
@attributes[:event_target_ids]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def event_target_ids=(value)
|
|
99
|
+
@attributes[:event_target_ids] = value
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# date-time - Event Subscription create date/time.
|
|
103
|
+
def created_at
|
|
104
|
+
@attributes[:created_at]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# date-time - Event Subscription update date/time.
|
|
108
|
+
def updated_at
|
|
109
|
+
@attributes[:updated_at]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Parameters:
|
|
113
|
+
# event_channel_id - int64 - Event Channel ID
|
|
114
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
115
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace subscription applies to events from all workspaces.
|
|
116
|
+
# name - string - Event Subscription name.
|
|
117
|
+
# enabled - boolean - Whether this Event Subscription can dispatch events.
|
|
118
|
+
# event_types - array(string) - Event type strings matched by this subscription. Blank means all event types.
|
|
119
|
+
# filter - object - Structured event payload filter.
|
|
120
|
+
# delivery_policy - object - Event Subscription delivery policy.
|
|
121
|
+
# event_target_ids - array(int64) - Event Target IDs this subscription sends to.
|
|
122
|
+
def update(params = {})
|
|
123
|
+
params ||= {}
|
|
124
|
+
params[:id] = @attributes[:id]
|
|
125
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
126
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
127
|
+
raise InvalidParameterError.new("Bad parameter: event_channel_id must be an Integer") if params[:event_channel_id] and !params[:event_channel_id].is_a?(Integer)
|
|
128
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
129
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
130
|
+
raise InvalidParameterError.new("Bad parameter: event_types must be an Array") if params[:event_types] and !params[:event_types].is_a?(Array)
|
|
131
|
+
raise InvalidParameterError.new("Bad parameter: event_target_ids must be an Array") if params[:event_target_ids] and !params[:event_target_ids].is_a?(Array)
|
|
132
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
133
|
+
|
|
134
|
+
Api.send_request("/event_subscriptions/#{@attributes[:id]}", :patch, params, @options)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def delete(params = {})
|
|
138
|
+
params ||= {}
|
|
139
|
+
params[:id] = @attributes[:id]
|
|
140
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
141
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
142
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
143
|
+
|
|
144
|
+
Api.send_request("/event_subscriptions/#{@attributes[:id]}", :delete, params, @options)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def destroy(params = {})
|
|
148
|
+
delete(params)
|
|
149
|
+
nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def save
|
|
153
|
+
if @attributes[:id]
|
|
154
|
+
new_obj = update(@attributes)
|
|
155
|
+
else
|
|
156
|
+
new_obj = EventSubscription.create(@attributes, @options)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@attributes = new_obj.attributes
|
|
160
|
+
true
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Parameters:
|
|
164
|
+
# cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
165
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
166
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `enabled`, `event_channel_id` or `workspace_id`.
|
|
167
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `enabled`, `event_channel_id` or `workspace_id`. Valid field combinations are `[ enabled, event_channel_id ]`, `[ workspace_id, enabled ]` or `[ workspace_id, enabled, event_channel_id ]`.
|
|
168
|
+
def self.list(params = {}, options = {})
|
|
169
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
170
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
171
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
172
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
173
|
+
|
|
174
|
+
List.new(EventSubscription, params) do
|
|
175
|
+
Api.send_request("/event_subscriptions", :get, params, options)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def self.all(params = {}, options = {})
|
|
180
|
+
list(params, options)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Parameters:
|
|
184
|
+
# id (required) - int64 - Event Subscription ID.
|
|
185
|
+
def self.find(id, params = {}, options = {})
|
|
186
|
+
params ||= {}
|
|
187
|
+
params[:id] = id
|
|
188
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
189
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
190
|
+
|
|
191
|
+
response, options = Api.send_request("/event_subscriptions/#{params[:id]}", :get, params, options)
|
|
192
|
+
EventSubscription.new(response.data, options)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def self.get(id, params = {}, options = {})
|
|
196
|
+
find(id, params, options)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Parameters:
|
|
200
|
+
# event_channel_id - int64 - Event Channel ID
|
|
201
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
202
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace subscription applies to events from all workspaces.
|
|
203
|
+
# name (required) - string - Event Subscription name.
|
|
204
|
+
# enabled - boolean - Whether this Event Subscription can dispatch events.
|
|
205
|
+
# event_types - array(string) - Event type strings matched by this subscription. Blank means all event types.
|
|
206
|
+
# filter - object - Structured event payload filter.
|
|
207
|
+
# delivery_policy - object - Event Subscription delivery policy.
|
|
208
|
+
# event_target_ids - array(int64) - Event Target IDs this subscription sends to.
|
|
209
|
+
def self.create(params = {}, options = {})
|
|
210
|
+
raise InvalidParameterError.new("Bad parameter: event_channel_id must be an Integer") if params[:event_channel_id] and !params[:event_channel_id].is_a?(Integer)
|
|
211
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
212
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
213
|
+
raise InvalidParameterError.new("Bad parameter: event_types must be an Array") if params[:event_types] and !params[:event_types].is_a?(Array)
|
|
214
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
215
|
+
raise InvalidParameterError.new("Bad parameter: delivery_policy must be an Hash") if params[:delivery_policy] and !params[:delivery_policy].is_a?(Hash)
|
|
216
|
+
raise InvalidParameterError.new("Bad parameter: event_target_ids must be an Array") if params[:event_target_ids] and !params[:event_target_ids].is_a?(Array)
|
|
217
|
+
raise MissingParameterError.new("Parameter missing: name") unless params[:name]
|
|
218
|
+
|
|
219
|
+
response, options = Api.send_request("/event_subscriptions", :post, params, options)
|
|
220
|
+
EventSubscription.new(response.data, options)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Parameters:
|
|
224
|
+
# event_channel_id - int64 - Event Channel ID
|
|
225
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
226
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace subscription applies to events from all workspaces.
|
|
227
|
+
# name - string - Event Subscription name.
|
|
228
|
+
# enabled - boolean - Whether this Event Subscription can dispatch events.
|
|
229
|
+
# event_types - array(string) - Event type strings matched by this subscription. Blank means all event types.
|
|
230
|
+
# filter - object - Structured event payload filter.
|
|
231
|
+
# delivery_policy - object - Event Subscription delivery policy.
|
|
232
|
+
# event_target_ids - array(int64) - Event Target IDs this subscription sends to.
|
|
233
|
+
def self.update(id, params = {}, options = {})
|
|
234
|
+
params ||= {}
|
|
235
|
+
params[:id] = id
|
|
236
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
237
|
+
raise InvalidParameterError.new("Bad parameter: event_channel_id must be an Integer") if params[:event_channel_id] and !params[:event_channel_id].is_a?(Integer)
|
|
238
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
239
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
240
|
+
raise InvalidParameterError.new("Bad parameter: event_types must be an Array") if params[:event_types] and !params[:event_types].is_a?(Array)
|
|
241
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
242
|
+
raise InvalidParameterError.new("Bad parameter: delivery_policy must be an Hash") if params[:delivery_policy] and !params[:delivery_policy].is_a?(Hash)
|
|
243
|
+
raise InvalidParameterError.new("Bad parameter: event_target_ids must be an Array") if params[:event_target_ids] and !params[:event_target_ids].is_a?(Array)
|
|
244
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
245
|
+
|
|
246
|
+
response, options = Api.send_request("/event_subscriptions/#{params[:id]}", :patch, params, options)
|
|
247
|
+
EventSubscription.new(response.data, options)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def self.delete(id, params = {}, options = {})
|
|
251
|
+
params ||= {}
|
|
252
|
+
params[:id] = id
|
|
253
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
254
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
255
|
+
|
|
256
|
+
Api.send_request("/event_subscriptions/#{params[:id]}", :delete, params, options)
|
|
257
|
+
nil
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def self.destroy(id, params = {}, options = {})
|
|
261
|
+
delete(id, params, options)
|
|
262
|
+
nil
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
end
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Files
|
|
4
|
+
class EventTarget
|
|
5
|
+
attr_reader :options, :attributes
|
|
6
|
+
|
|
7
|
+
def initialize(attributes = {}, options = {})
|
|
8
|
+
@attributes = attributes || {}
|
|
9
|
+
@options = options || {}
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# int64 - Event Target ID
|
|
13
|
+
def id
|
|
14
|
+
@attributes[:id]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def id=(value)
|
|
18
|
+
@attributes[:id] = value
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# string - Event Target name.
|
|
22
|
+
def name
|
|
23
|
+
@attributes[:name]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def name=(value)
|
|
27
|
+
@attributes[:name] = value
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# string - Event Target type.
|
|
31
|
+
def target_type
|
|
32
|
+
@attributes[:target_type]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def target_type=(value)
|
|
36
|
+
@attributes[:target_type] = value
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
40
|
+
def workspace_id
|
|
41
|
+
@attributes[:workspace_id]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def workspace_id=(value)
|
|
45
|
+
@attributes[:workspace_id] = value
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# boolean - If true, this default-workspace target can receive events from all workspaces.
|
|
49
|
+
def apply_to_all_workspaces
|
|
50
|
+
@attributes[:apply_to_all_workspaces]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def apply_to_all_workspaces=(value)
|
|
54
|
+
@attributes[:apply_to_all_workspaces] = value
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# boolean - Whether this Event Target can receive events.
|
|
58
|
+
def enabled
|
|
59
|
+
@attributes[:enabled]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def enabled=(value)
|
|
63
|
+
@attributes[:enabled] = value
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# object - Event Target configuration.
|
|
67
|
+
def config
|
|
68
|
+
@attributes[:config]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def config=(value)
|
|
72
|
+
@attributes[:config] = value
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# object - Event Target delivery policy. Email targets support batch_interval in seconds, between 600 and 86400.
|
|
76
|
+
def delivery_policy
|
|
77
|
+
@attributes[:delivery_policy]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def delivery_policy=(value)
|
|
81
|
+
@attributes[:delivery_policy] = value
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# date-time - Event Target create date/time.
|
|
85
|
+
def created_at
|
|
86
|
+
@attributes[:created_at]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# date-time - Event Target update date/time.
|
|
90
|
+
def updated_at
|
|
91
|
+
@attributes[:updated_at]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Parameters:
|
|
95
|
+
# name - string - Event Target name.
|
|
96
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
97
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace target can receive events from all workspaces.
|
|
98
|
+
# target_type - string - Event Target type.
|
|
99
|
+
# enabled - boolean - Whether this Event Target can receive events.
|
|
100
|
+
# config - object - Event Target configuration.
|
|
101
|
+
# delivery_policy - object - Event Target delivery policy. Email targets support batch_interval in seconds, between 600 and 86400.
|
|
102
|
+
def update(params = {})
|
|
103
|
+
params ||= {}
|
|
104
|
+
params[:id] = @attributes[:id]
|
|
105
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
106
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
107
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
108
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
109
|
+
raise InvalidParameterError.new("Bad parameter: target_type must be an String") if params[:target_type] and !params[:target_type].is_a?(String)
|
|
110
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
111
|
+
|
|
112
|
+
Api.send_request("/event_targets/#{@attributes[:id]}", :patch, params, @options)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def delete(params = {})
|
|
116
|
+
params ||= {}
|
|
117
|
+
params[:id] = @attributes[:id]
|
|
118
|
+
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
|
119
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
120
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
121
|
+
|
|
122
|
+
Api.send_request("/event_targets/#{@attributes[:id]}", :delete, params, @options)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def destroy(params = {})
|
|
126
|
+
delete(params)
|
|
127
|
+
nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def save
|
|
131
|
+
if @attributes[:id]
|
|
132
|
+
new_obj = update(@attributes)
|
|
133
|
+
else
|
|
134
|
+
new_obj = EventTarget.create(@attributes, @options)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@attributes = new_obj.attributes
|
|
138
|
+
true
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Parameters:
|
|
142
|
+
# cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
143
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
144
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `enabled` and `workspace_id`.
|
|
145
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `enabled`, `target_type` or `workspace_id`. Valid field combinations are `[ enabled, target_type ]`, `[ workspace_id, enabled ]` or `[ workspace_id, enabled, target_type ]`.
|
|
146
|
+
def self.list(params = {}, options = {})
|
|
147
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
|
|
148
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
|
|
149
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
|
|
150
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
|
|
151
|
+
|
|
152
|
+
List.new(EventTarget, params) do
|
|
153
|
+
Api.send_request("/event_targets", :get, params, options)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def self.all(params = {}, options = {})
|
|
158
|
+
list(params, options)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Parameters:
|
|
162
|
+
# id (required) - int64 - Event Target ID.
|
|
163
|
+
def self.find(id, params = {}, options = {})
|
|
164
|
+
params ||= {}
|
|
165
|
+
params[:id] = id
|
|
166
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
167
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
168
|
+
|
|
169
|
+
response, options = Api.send_request("/event_targets/#{params[:id]}", :get, params, options)
|
|
170
|
+
EventTarget.new(response.data, options)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def self.get(id, params = {}, options = {})
|
|
174
|
+
find(id, params, options)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Parameters:
|
|
178
|
+
# name (required) - string - Event Target name.
|
|
179
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
180
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace target can receive events from all workspaces.
|
|
181
|
+
# target_type (required) - string - Event Target type.
|
|
182
|
+
# enabled - boolean - Whether this Event Target can receive events.
|
|
183
|
+
# config (required) - object - Event Target configuration.
|
|
184
|
+
# delivery_policy - object - Event Target delivery policy. Email targets support batch_interval in seconds, between 600 and 86400.
|
|
185
|
+
def self.create(params = {}, options = {})
|
|
186
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
187
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
188
|
+
raise InvalidParameterError.new("Bad parameter: target_type must be an String") if params[:target_type] and !params[:target_type].is_a?(String)
|
|
189
|
+
raise InvalidParameterError.new("Bad parameter: config must be an Hash") if params[:config] and !params[:config].is_a?(Hash)
|
|
190
|
+
raise InvalidParameterError.new("Bad parameter: delivery_policy must be an Hash") if params[:delivery_policy] and !params[:delivery_policy].is_a?(Hash)
|
|
191
|
+
raise MissingParameterError.new("Parameter missing: name") unless params[:name]
|
|
192
|
+
raise MissingParameterError.new("Parameter missing: target_type") unless params[:target_type]
|
|
193
|
+
raise MissingParameterError.new("Parameter missing: config") unless params[:config]
|
|
194
|
+
|
|
195
|
+
response, options = Api.send_request("/event_targets", :post, params, options)
|
|
196
|
+
EventTarget.new(response.data, options)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Parameters:
|
|
200
|
+
# name - string - Event Target name.
|
|
201
|
+
# workspace_id - int64 - Workspace ID. 0 means the default workspace or site-wide.
|
|
202
|
+
# apply_to_all_workspaces - boolean - If true, this default-workspace target can receive events from all workspaces.
|
|
203
|
+
# target_type - string - Event Target type.
|
|
204
|
+
# enabled - boolean - Whether this Event Target can receive events.
|
|
205
|
+
# config - object - Event Target configuration.
|
|
206
|
+
# delivery_policy - object - Event Target delivery policy. Email targets support batch_interval in seconds, between 600 and 86400.
|
|
207
|
+
def self.update(id, params = {}, options = {})
|
|
208
|
+
params ||= {}
|
|
209
|
+
params[:id] = id
|
|
210
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
211
|
+
raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
|
|
212
|
+
raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)
|
|
213
|
+
raise InvalidParameterError.new("Bad parameter: target_type must be an String") if params[:target_type] and !params[:target_type].is_a?(String)
|
|
214
|
+
raise InvalidParameterError.new("Bad parameter: config must be an Hash") if params[:config] and !params[:config].is_a?(Hash)
|
|
215
|
+
raise InvalidParameterError.new("Bad parameter: delivery_policy must be an Hash") if params[:delivery_policy] and !params[:delivery_policy].is_a?(Hash)
|
|
216
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
217
|
+
|
|
218
|
+
response, options = Api.send_request("/event_targets/#{params[:id]}", :patch, params, options)
|
|
219
|
+
EventTarget.new(response.data, options)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def self.delete(id, params = {}, options = {})
|
|
223
|
+
params ||= {}
|
|
224
|
+
params[:id] = id
|
|
225
|
+
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
|
226
|
+
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
|
227
|
+
|
|
228
|
+
Api.send_request("/event_targets/#{params[:id]}", :delete, params, options)
|
|
229
|
+
nil
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def self.destroy(id, params = {}, options = {})
|
|
233
|
+
delete(id, params, options)
|
|
234
|
+
nil
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
@@ -59,78 +59,6 @@ module Files
|
|
|
59
59
|
@attributes[:body_url] = value
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
# int64 - Folder Behavior ID
|
|
63
|
-
def folder_behavior_id
|
|
64
|
-
@attributes[:folder_behavior_id]
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def folder_behavior_id=(value)
|
|
68
|
-
@attributes[:folder_behavior_id] = value
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# int64 - SIEM HTTP Destination ID.
|
|
72
|
-
def siem_http_destination_id
|
|
73
|
-
@attributes[:siem_http_destination_id]
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def siem_http_destination_id=(value)
|
|
77
|
-
@attributes[:siem_http_destination_id] = value
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# int64 - For sync events, the number of files handled successfully.
|
|
81
|
-
def successful_files
|
|
82
|
-
@attributes[:successful_files]
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def successful_files=(value)
|
|
86
|
-
@attributes[:successful_files] = value
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# int64 - For sync events, the number of files that encountered errors.
|
|
90
|
-
def errored_files
|
|
91
|
-
@attributes[:errored_files]
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def errored_files=(value)
|
|
95
|
-
@attributes[:errored_files] = value
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
# int64 - For sync events, the total number of bytes synced.
|
|
99
|
-
def bytes_synced
|
|
100
|
-
@attributes[:bytes_synced]
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
def bytes_synced=(value)
|
|
104
|
-
@attributes[:bytes_synced] = value
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# int64 - For sync events, the number of files considered for the sync.
|
|
108
|
-
def compared_files
|
|
109
|
-
@attributes[:compared_files]
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def compared_files=(value)
|
|
113
|
-
@attributes[:compared_files] = value
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
# int64 - For sync events, the number of folders listed and considered for the sync.
|
|
117
|
-
def compared_folders
|
|
118
|
-
@attributes[:compared_folders]
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
def compared_folders=(value)
|
|
122
|
-
@attributes[:compared_folders] = value
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
# string - Associated Remote Server type, if any
|
|
126
|
-
def remote_server_type
|
|
127
|
-
@attributes[:remote_server_type]
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def remote_server_type=(value)
|
|
131
|
-
@attributes[:remote_server_type] = value
|
|
132
|
-
end
|
|
133
|
-
|
|
134
62
|
def save
|
|
135
63
|
if @attributes[:id]
|
|
136
64
|
raise NotImplementedError.new("The ExternalEvent object doesn't support updates.")
|
|
@@ -145,8 +73,8 @@ module Files
|
|
|
145
73
|
# Parameters:
|
|
146
74
|
# cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
147
75
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
148
|
-
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `
|
|
149
|
-
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at
|
|
76
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `status` or `event_type`.
|
|
77
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at` and `status`. Valid field combinations are `[ status, created_at ]`.
|
|
150
78
|
# filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
|
|
151
79
|
# filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
|
|
152
80
|
# filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|