files.com 1.1.621 → 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.
@@ -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 `siem_http_destination_id`, `created_at`, `event_type`, `status` or `folder_behavior_id`.
149
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status`, `folder_behavior_id` or `siem_http_destination_id`. Valid field combinations are `[ event_type, created_at ]`, `[ remote_server_type, created_at ]`, `[ status, created_at ]`, `[ folder_behavior_id, created_at ]`, `[ event_type, status ]`, `[ remote_server_type, status ]`, `[ folder_behavior_id, status ]`, `[ event_type, status, created_at ]`, `[ remote_server_type, status, created_at ]` or `[ folder_behavior_id, status, 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`.
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class PendingWorkEvent
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Event ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # string - Type of pending work event being recorded.
18
+ def event_type
19
+ @attributes[:event_type]
20
+ end
21
+
22
+ # string - Status of event.
23
+ def status
24
+ @attributes[:status]
25
+ end
26
+
27
+ # string - Event body.
28
+ def body
29
+ @attributes[:body]
30
+ end
31
+
32
+ # array(string) - Event errors.
33
+ def event_errors
34
+ @attributes[:event_errors]
35
+ end
36
+
37
+ # date-time - Event create date/time.
38
+ def created_at
39
+ @attributes[:created_at]
40
+ end
41
+
42
+ # string - Link to log file.
43
+ def body_url
44
+ @attributes[:body_url]
45
+ end
46
+
47
+ # int64 - Folder Behavior ID.
48
+ def folder_behavior_id
49
+ @attributes[:folder_behavior_id]
50
+ end
51
+
52
+ # Parameters:
53
+ # 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.
54
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
55
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `status` or `folder_behavior_id`.
56
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `status`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ status, created_at ]`, `[ folder_behavior_id, status ]` or `[ folder_behavior_id, status, created_at ]`.
57
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
58
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
59
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
60
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
61
+ def self.list(params = {}, options = {})
62
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
63
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
64
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
65
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
66
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash)
67
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash)
68
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
69
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
70
+
71
+ List.new(PendingWorkEvent, params) do
72
+ Api.send_request("/pending_work_events", :get, params, options)
73
+ end
74
+ end
75
+
76
+ def self.all(params = {}, options = {})
77
+ list(params, options)
78
+ end
79
+
80
+ # Parameters:
81
+ # id (required) - int64 - Pending Work Event ID.
82
+ def self.find(id, params = {}, options = {})
83
+ params ||= {}
84
+ params[:id] = id
85
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
86
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
87
+
88
+ response, options = Api.send_request("/pending_work_events/#{params[:id]}", :get, params, options)
89
+ PendingWorkEvent.new(response.data, options)
90
+ end
91
+
92
+ def self.get(id, params = {}, options = {})
93
+ find(id, params, options)
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class SiemHttpDestinationEvent
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Event ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # string - Type of SIEM event being recorded.
18
+ def event_type
19
+ @attributes[:event_type]
20
+ end
21
+
22
+ # string - Status of event.
23
+ def status
24
+ @attributes[:status]
25
+ end
26
+
27
+ # string - Event body.
28
+ def body
29
+ @attributes[:body]
30
+ end
31
+
32
+ # array(string) - Event errors.
33
+ def event_errors
34
+ @attributes[:event_errors]
35
+ end
36
+
37
+ # date-time - Event create date/time.
38
+ def created_at
39
+ @attributes[:created_at]
40
+ end
41
+
42
+ # string - Link to log file.
43
+ def body_url
44
+ @attributes[:body_url]
45
+ end
46
+
47
+ # int64 - SIEM ID.
48
+ def siem_http_destination_id
49
+ @attributes[:siem_http_destination_id]
50
+ end
51
+
52
+ # Parameters:
53
+ # 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.
54
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
55
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `status` or `siem_http_destination_id`.
56
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `siem_http_destination_id` or `status`. Valid field combinations are `[ siem_http_destination_id, created_at ]`, `[ status, created_at ]`, `[ siem_http_destination_id, status ]` or `[ siem_http_destination_id, status, created_at ]`.
57
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
58
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
59
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
60
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
61
+ def self.list(params = {}, options = {})
62
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
63
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
64
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
65
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
66
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash)
67
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash)
68
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
69
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
70
+
71
+ List.new(SiemHttpDestinationEvent, params) do
72
+ Api.send_request("/siem_http_destination_events", :get, params, options)
73
+ end
74
+ end
75
+
76
+ def self.all(params = {}, options = {})
77
+ list(params, options)
78
+ end
79
+
80
+ # Parameters:
81
+ # id (required) - int64 - Siem Http Destination Event ID.
82
+ def self.find(id, params = {}, options = {})
83
+ params ||= {}
84
+ params[:id] = id
85
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
86
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
87
+
88
+ response, options = Api.send_request("/siem_http_destination_events/#{params[:id]}", :get, params, options)
89
+ SiemHttpDestinationEvent.new(response.data, options)
90
+ end
91
+
92
+ def self.get(id, params = {}, options = {})
93
+ find(id, params, options)
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,128 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class SsoEvent
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Event ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # string - Type of SSO event being recorded.
18
+ def event_type
19
+ @attributes[:event_type]
20
+ end
21
+
22
+ # string - Status of event.
23
+ def status
24
+ @attributes[:status]
25
+ end
26
+
27
+ # string - Event body.
28
+ def body
29
+ @attributes[:body]
30
+ end
31
+
32
+ # array(string) - Event errors.
33
+ def event_errors
34
+ @attributes[:event_errors]
35
+ end
36
+
37
+ # date-time - Event create date/time.
38
+ def created_at
39
+ @attributes[:created_at]
40
+ end
41
+
42
+ # string - Link to log file.
43
+ def body_url
44
+ @attributes[:body_url]
45
+ end
46
+
47
+ # int64 - User ID.
48
+ def user_id
49
+ @attributes[:user_id]
50
+ end
51
+
52
+ # string - Username on Files.com for the SSO login attempt.
53
+ def username
54
+ @attributes[:username]
55
+ end
56
+
57
+ # string - Identity Provider UID for the SSO login attempt.
58
+ def idp_uid
59
+ @attributes[:idp_uid]
60
+ end
61
+
62
+ # string - SSO provider for the SSO login attempt.
63
+ def provider
64
+ @attributes[:provider]
65
+ end
66
+
67
+ # string - SSO provider label for the SSO login attempt.
68
+ def provider_label
69
+ @attributes[:provider_label]
70
+ end
71
+
72
+ # string - IP address for the SSO login attempt.
73
+ def ip
74
+ @attributes[:ip]
75
+ end
76
+
77
+ # string - Region for the SSO login attempt.
78
+ def region
79
+ @attributes[:region]
80
+ end
81
+
82
+ # Parameters:
83
+ # 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.
84
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
85
+ # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `event_type`, `status` or `user_id`.
86
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `idp_uid`, `ip`, `provider`, `status`, `user_id` or `username`. Valid field combinations are `[ event_type, created_at ]`, `[ idp_uid, created_at ]`, `[ ip, created_at ]`, `[ provider, created_at ]`, `[ status, created_at ]`, `[ user_id, created_at ]`, `[ username, created_at ]`, `[ event_type, status ]`, `[ idp_uid, status ]`, `[ ip, status ]`, `[ provider, status ]`, `[ user_id, status ]`, `[ username, status ]`, `[ event_type, status, created_at ]`, `[ idp_uid, status, created_at ]`, `[ ip, status, created_at ]`, `[ provider, status, created_at ]`, `[ user_id, status, created_at ]` or `[ username, status, created_at ]`.
87
+ # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
88
+ # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
89
+ # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `idp_uid`, `ip`, `provider` or `username`.
90
+ # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
91
+ # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
92
+ def self.list(params = {}, options = {})
93
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
94
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
95
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
96
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
97
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params[:filter_gt] and !params[:filter_gt].is_a?(Hash)
98
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params[:filter_gteq] and !params[:filter_gteq].is_a?(Hash)
99
+ raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)
100
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params[:filter_lt] and !params[:filter_lt].is_a?(Hash)
101
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params[:filter_lteq] and !params[:filter_lteq].is_a?(Hash)
102
+
103
+ List.new(SsoEvent, params) do
104
+ Api.send_request("/sso_events", :get, params, options)
105
+ end
106
+ end
107
+
108
+ def self.all(params = {}, options = {})
109
+ list(params, options)
110
+ end
111
+
112
+ # Parameters:
113
+ # id (required) - int64 - Sso Event ID.
114
+ def self.find(id, params = {}, options = {})
115
+ params ||= {}
116
+ params[:id] = id
117
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
118
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
119
+
120
+ response, options = Api.send_request("/sso_events/#{params[:id]}", :get, params, options)
121
+ SsoEvent.new(response.data, options)
122
+ end
123
+
124
+ def self.get(id, params = {}, options = {})
125
+ find(id, params, options)
126
+ end
127
+ end
128
+ end