files.com 1.2.125 → 1.2.126

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,805 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import Api from '../Api'
3
+ import * as errors from '../Errors'
4
+ import {
5
+ getType, isArray, isInt, isObject, isString,
6
+ } from '../utils'
7
+ /* eslint-enable no-unused-vars */
8
+
9
+ /**
10
+ * Class SiemHttpDestination
11
+ */
12
+ class SiemHttpDestination {
13
+ attributes = {}
14
+
15
+ options = {}
16
+
17
+ constructor(attributes = {}, options = {}) {
18
+ Object.entries(attributes).forEach(([key, value]) => {
19
+ const normalizedKey = key.replace('?', '')
20
+
21
+ this.attributes[normalizedKey] = value
22
+
23
+ Object.defineProperty(this, normalizedKey, { value, writable: false })
24
+ })
25
+
26
+ this.options = { ...options }
27
+ }
28
+
29
+ isLoaded = () => !!this.attributes.id
30
+
31
+ // int64 # SIEM HTTP Destination ID
32
+ getId = () => this.attributes.id
33
+
34
+ setId = value => {
35
+ this.attributes.id = value
36
+ }
37
+
38
+ // string # Name for this Destination
39
+ getName = () => this.attributes.name
40
+
41
+ setName = value => {
42
+ this.attributes.name = value
43
+ }
44
+
45
+ // string # Destination Type
46
+ getDestinationType = () => this.attributes.destination_type
47
+
48
+ setDestinationType = value => {
49
+ this.attributes.destination_type = value
50
+ }
51
+
52
+ // string # Destination Url
53
+ getDestinationUrl = () => this.attributes.destination_url
54
+
55
+ setDestinationUrl = value => {
56
+ this.attributes.destination_url = value
57
+ }
58
+
59
+ // object # Additional HTTP Headers included in calls to the destination URL
60
+ getAdditionalHeaders = () => this.attributes.additional_headers
61
+
62
+ setAdditionalHeaders = value => {
63
+ this.attributes.additional_headers = value
64
+ }
65
+
66
+ // boolean # Whether this SIEM HTTP Destination is currently being sent to or not
67
+ getSendingActive = () => this.attributes.sending_active
68
+
69
+ setSendingActive = value => {
70
+ this.attributes.sending_active = value
71
+ }
72
+
73
+ // string # Applicable only for destination type: generic. Indicates the type of HTTP body. Can be json_newline or json_array. json_newline is multiple log entries as JSON separated by newlines. json_array is a single JSON array containing multiple log entries as JSON.
74
+ getGenericPayloadType = () => this.attributes.generic_payload_type
75
+
76
+ setGenericPayloadType = value => {
77
+ this.attributes.generic_payload_type = value
78
+ }
79
+
80
+ // string # Applicable only for destination type: splunk. Authentication token provided by Splunk.
81
+ getSplunkTokenMasked = () => this.attributes.splunk_token_masked
82
+
83
+ setSplunkTokenMasked = value => {
84
+ this.attributes.splunk_token_masked = value
85
+ }
86
+
87
+ // string # Applicable only for destination type: azure. Immutable ID of the Data Collection Rule.
88
+ getAzureDcrImmutableId = () => this.attributes.azure_dcr_immutable_id
89
+
90
+ setAzureDcrImmutableId = value => {
91
+ this.attributes.azure_dcr_immutable_id = value
92
+ }
93
+
94
+ // string # Applicable only for destination type: azure. Name of the stream in the DCR that represents the destination table.
95
+ getAzureStreamName = () => this.attributes.azure_stream_name
96
+
97
+ setAzureStreamName = value => {
98
+ this.attributes.azure_stream_name = value
99
+ }
100
+
101
+ // string # Applicable only for destination type: azure. Client Credentials OAuth Tenant ID.
102
+ getAzureOauthClientCredentialsTenantId = () => this.attributes.azure_oauth_client_credentials_tenant_id
103
+
104
+ setAzureOauthClientCredentialsTenantId = value => {
105
+ this.attributes.azure_oauth_client_credentials_tenant_id = value
106
+ }
107
+
108
+ // string # Applicable only for destination type: azure. Client Credentials OAuth Client ID.
109
+ getAzureOauthClientCredentialsClientId = () => this.attributes.azure_oauth_client_credentials_client_id
110
+
111
+ setAzureOauthClientCredentialsClientId = value => {
112
+ this.attributes.azure_oauth_client_credentials_client_id = value
113
+ }
114
+
115
+ // string # Applicable only for destination type: azure. Client Credentials OAuth Client Secret.
116
+ getAzureOauthClientCredentialsClientSecretMasked = () => this.attributes.azure_oauth_client_credentials_client_secret_masked
117
+
118
+ setAzureOauthClientCredentialsClientSecretMasked = value => {
119
+ this.attributes.azure_oauth_client_credentials_client_secret_masked = value
120
+ }
121
+
122
+ // string # Applicable only for destination type: qradar. Basic auth username provided by QRadar.
123
+ getQradarUsername = () => this.attributes.qradar_username
124
+
125
+ setQradarUsername = value => {
126
+ this.attributes.qradar_username = value
127
+ }
128
+
129
+ // string # Applicable only for destination type: qradar. Basic auth password provided by QRadar.
130
+ getQradarPasswordMasked = () => this.attributes.qradar_password_masked
131
+
132
+ setQradarPasswordMasked = value => {
133
+ this.attributes.qradar_password_masked = value
134
+ }
135
+
136
+ // string # Applicable only for destination type: solar_winds. Authentication token provided by Solar Winds.
137
+ getSolarWindsTokenMasked = () => this.attributes.solar_winds_token_masked
138
+
139
+ setSolarWindsTokenMasked = value => {
140
+ this.attributes.solar_winds_token_masked = value
141
+ }
142
+
143
+ // string # Applicable only for destination type: new_relic. API key provided by New Relic.
144
+ getNewRelicApiKeyMasked = () => this.attributes.new_relic_api_key_masked
145
+
146
+ setNewRelicApiKeyMasked = value => {
147
+ this.attributes.new_relic_api_key_masked = value
148
+ }
149
+
150
+ // string # Applicable only for destination type: datadog. API key provided by Datadog.
151
+ getDatadogApiKeyMasked = () => this.attributes.datadog_api_key_masked
152
+
153
+ setDatadogApiKeyMasked = value => {
154
+ this.attributes.datadog_api_key_masked = value
155
+ }
156
+
157
+ // boolean # Whether or not sending is enabled for sftp_action logs.
158
+ getSftpActionSendEnabled = () => this.attributes.sftp_action_send_enabled
159
+
160
+ setSftpActionSendEnabled = value => {
161
+ this.attributes.sftp_action_send_enabled = value
162
+ }
163
+
164
+ // int64 # Number of log entries sent for the lifetime of this destination.
165
+ getSftpActionRecordsSentEntriesSent = () => this.attributes.sftp_action_records_sent_entries_sent
166
+
167
+ setSftpActionRecordsSentEntriesSent = value => {
168
+ this.attributes.sftp_action_records_sent_entries_sent = value
169
+ }
170
+
171
+ // boolean # Whether or not sending is enabled for ftp_action logs.
172
+ getFtpActionSendEnabled = () => this.attributes.ftp_action_send_enabled
173
+
174
+ setFtpActionSendEnabled = value => {
175
+ this.attributes.ftp_action_send_enabled = value
176
+ }
177
+
178
+ // int64 # Number of log entries sent for the lifetime of this destination.
179
+ getFtpActionRecordsSentEntriesSent = () => this.attributes.ftp_action_records_sent_entries_sent
180
+
181
+ setFtpActionRecordsSentEntriesSent = value => {
182
+ this.attributes.ftp_action_records_sent_entries_sent = value
183
+ }
184
+
185
+ // boolean # Whether or not sending is enabled for web_dav_action logs.
186
+ getWebDavActionSendEnabled = () => this.attributes.web_dav_action_send_enabled
187
+
188
+ setWebDavActionSendEnabled = value => {
189
+ this.attributes.web_dav_action_send_enabled = value
190
+ }
191
+
192
+ // int64 # Number of log entries sent for the lifetime of this destination.
193
+ getWebDavActionRecordsSentEntriesSent = () => this.attributes.web_dav_action_records_sent_entries_sent
194
+
195
+ setWebDavActionRecordsSentEntriesSent = value => {
196
+ this.attributes.web_dav_action_records_sent_entries_sent = value
197
+ }
198
+
199
+ // boolean # Whether or not sending is enabled for sync logs.
200
+ getSyncSendEnabled = () => this.attributes.sync_send_enabled
201
+
202
+ setSyncSendEnabled = value => {
203
+ this.attributes.sync_send_enabled = value
204
+ }
205
+
206
+ // int64 # Number of log entries sent for the lifetime of this destination.
207
+ getSyncRecordsSentEntriesSent = () => this.attributes.sync_records_sent_entries_sent
208
+
209
+ setSyncRecordsSentEntriesSent = value => {
210
+ this.attributes.sync_records_sent_entries_sent = value
211
+ }
212
+
213
+ // boolean # Whether or not sending is enabled for outbound_connection logs.
214
+ getOutboundConnectionSendEnabled = () => this.attributes.outbound_connection_send_enabled
215
+
216
+ setOutboundConnectionSendEnabled = value => {
217
+ this.attributes.outbound_connection_send_enabled = value
218
+ }
219
+
220
+ // int64 # Number of log entries sent for the lifetime of this destination.
221
+ getOutboundConnectionRecordsSentEntriesSent = () => this.attributes.outbound_connection_records_sent_entries_sent
222
+
223
+ setOutboundConnectionRecordsSentEntriesSent = value => {
224
+ this.attributes.outbound_connection_records_sent_entries_sent = value
225
+ }
226
+
227
+ // boolean # Whether or not sending is enabled for automation logs.
228
+ getAutomationSendEnabled = () => this.attributes.automation_send_enabled
229
+
230
+ setAutomationSendEnabled = value => {
231
+ this.attributes.automation_send_enabled = value
232
+ }
233
+
234
+ // int64 # Number of log entries sent for the lifetime of this destination.
235
+ getAutomationRecordsSentEntriesSent = () => this.attributes.automation_records_sent_entries_sent
236
+
237
+ setAutomationRecordsSentEntriesSent = value => {
238
+ this.attributes.automation_records_sent_entries_sent = value
239
+ }
240
+
241
+ // boolean # Whether or not sending is enabled for api_request logs.
242
+ getApiRequestSendEnabled = () => this.attributes.api_request_send_enabled
243
+
244
+ setApiRequestSendEnabled = value => {
245
+ this.attributes.api_request_send_enabled = value
246
+ }
247
+
248
+ // int64 # Number of log entries sent for the lifetime of this destination.
249
+ getApiRequestRecordsSentEntriesSent = () => this.attributes.api_request_records_sent_entries_sent
250
+
251
+ setApiRequestRecordsSentEntriesSent = value => {
252
+ this.attributes.api_request_records_sent_entries_sent = value
253
+ }
254
+
255
+ // boolean # Whether or not sending is enabled for public_hosting_request logs.
256
+ getPublicHostingRequestSendEnabled = () => this.attributes.public_hosting_request_send_enabled
257
+
258
+ setPublicHostingRequestSendEnabled = value => {
259
+ this.attributes.public_hosting_request_send_enabled = value
260
+ }
261
+
262
+ // int64 # Number of log entries sent for the lifetime of this destination.
263
+ getPublicHostingRequestRecordsSentEntriesSent = () => this.attributes.public_hosting_request_records_sent_entries_sent
264
+
265
+ setPublicHostingRequestRecordsSentEntriesSent = value => {
266
+ this.attributes.public_hosting_request_records_sent_entries_sent = value
267
+ }
268
+
269
+ // boolean # Whether or not sending is enabled for email logs.
270
+ getEmailSendEnabled = () => this.attributes.email_send_enabled
271
+
272
+ setEmailSendEnabled = value => {
273
+ this.attributes.email_send_enabled = value
274
+ }
275
+
276
+ // int64 # Number of log entries sent for the lifetime of this destination.
277
+ getEmailRecordsSentEntriesSent = () => this.attributes.email_records_sent_entries_sent
278
+
279
+ setEmailRecordsSentEntriesSent = value => {
280
+ this.attributes.email_records_sent_entries_sent = value
281
+ }
282
+
283
+ // boolean # Whether or not sending is enabled for exavault_api_request logs.
284
+ getExavaultApiRequestSendEnabled = () => this.attributes.exavault_api_request_send_enabled
285
+
286
+ setExavaultApiRequestSendEnabled = value => {
287
+ this.attributes.exavault_api_request_send_enabled = value
288
+ }
289
+
290
+ // int64 # Number of log entries sent for the lifetime of this destination.
291
+ getExavaultApiRequestRecordsSentEntriesSent = () => this.attributes.exavault_api_request_records_sent_entries_sent
292
+
293
+ setExavaultApiRequestRecordsSentEntriesSent = value => {
294
+ this.attributes.exavault_api_request_records_sent_entries_sent = value
295
+ }
296
+
297
+ // string # Type of URL that was last called. Can be `destination_url` or `azure_oauth_client_credentials_url`
298
+ getLastHttpCallTargetType = () => this.attributes.last_http_call_target_type
299
+
300
+ setLastHttpCallTargetType = value => {
301
+ this.attributes.last_http_call_target_type = value
302
+ }
303
+
304
+ // boolean # Was the last HTTP call made successful?
305
+ getLastHttpCallSuccess = () => this.attributes.last_http_call_success
306
+
307
+ setLastHttpCallSuccess = value => {
308
+ this.attributes.last_http_call_success = value
309
+ }
310
+
311
+ // int64 # Last HTTP Call Response Code
312
+ getLastHttpCallResponseCode = () => this.attributes.last_http_call_response_code
313
+
314
+ setLastHttpCallResponseCode = value => {
315
+ this.attributes.last_http_call_response_code = value
316
+ }
317
+
318
+ // string # Last HTTP Call Response Body. Large responses are truncated.
319
+ getLastHttpCallResponseBody = () => this.attributes.last_http_call_response_body
320
+
321
+ setLastHttpCallResponseBody = value => {
322
+ this.attributes.last_http_call_response_body = value
323
+ }
324
+
325
+ // string # Last HTTP Call Error Message if applicable
326
+ getLastHttpCallErrorMessage = () => this.attributes.last_http_call_error_message
327
+
328
+ setLastHttpCallErrorMessage = value => {
329
+ this.attributes.last_http_call_error_message = value
330
+ }
331
+
332
+ // string # Time of Last HTTP Call
333
+ getLastHttpCallTime = () => this.attributes.last_http_call_time
334
+
335
+ setLastHttpCallTime = value => {
336
+ this.attributes.last_http_call_time = value
337
+ }
338
+
339
+ // int64 # Duration of the last HTTP Call in milliseconds
340
+ getLastHttpCallDurationMs = () => this.attributes.last_http_call_duration_ms
341
+
342
+ setLastHttpCallDurationMs = value => {
343
+ this.attributes.last_http_call_duration_ms = value
344
+ }
345
+
346
+ // string # Time of Most Recent Successful HTTP Call
347
+ getMostRecentHttpCallSuccessTime = () => this.attributes.most_recent_http_call_success_time
348
+
349
+ setMostRecentHttpCallSuccessTime = value => {
350
+ this.attributes.most_recent_http_call_success_time = value
351
+ }
352
+
353
+ // string # Connection Test Entry
354
+ getConnectionTestEntry = () => this.attributes.connection_test_entry
355
+
356
+ setConnectionTestEntry = value => {
357
+ this.attributes.connection_test_entry = value
358
+ }
359
+
360
+ // string # Applicable only for destination type: splunk. Authentication token provided by Splunk.
361
+ getSplunkToken = () => this.attributes.splunk_token
362
+
363
+ setSplunkToken = value => {
364
+ this.attributes.splunk_token = value
365
+ }
366
+
367
+ // string # Applicable only for destination type: azure. Client Credentials OAuth Client Secret.
368
+ getAzureOauthClientCredentialsClientSecret = () => this.attributes.azure_oauth_client_credentials_client_secret
369
+
370
+ setAzureOauthClientCredentialsClientSecret = value => {
371
+ this.attributes.azure_oauth_client_credentials_client_secret = value
372
+ }
373
+
374
+ // string # Applicable only for destination type: qradar. Basic auth password provided by QRadar.
375
+ getQradarPassword = () => this.attributes.qradar_password
376
+
377
+ setQradarPassword = value => {
378
+ this.attributes.qradar_password = value
379
+ }
380
+
381
+ // string # Applicable only for destination type: solar_winds. Authentication token provided by Solar Winds.
382
+ getSolarWindsToken = () => this.attributes.solar_winds_token
383
+
384
+ setSolarWindsToken = value => {
385
+ this.attributes.solar_winds_token = value
386
+ }
387
+
388
+ // string # Applicable only for destination type: new_relic. API key provided by New Relic.
389
+ getNewRelicApiKey = () => this.attributes.new_relic_api_key
390
+
391
+ setNewRelicApiKey = value => {
392
+ this.attributes.new_relic_api_key = value
393
+ }
394
+
395
+ // string # Applicable only for destination type: datadog. API key provided by Datadog.
396
+ getDatadogApiKey = () => this.attributes.datadog_api_key
397
+
398
+ setDatadogApiKey = value => {
399
+ this.attributes.datadog_api_key = value
400
+ }
401
+
402
+ // Parameters:
403
+ // name - string - Name for this Destination
404
+ // additional_headers - object - Additional HTTP Headers included in calls to the destination URL
405
+ // sending_active - boolean - Whether this SIEM HTTP Destination is currently being sent to or not
406
+ // generic_payload_type - string - Applicable only for destination type: generic. Indicates the type of HTTP body. Can be json_newline or json_array. json_newline is multiple log entries as JSON separated by newlines. json_array is a single JSON array containing multiple log entries as JSON.
407
+ // splunk_token - string - Applicable only for destination type: splunk. Authentication token provided by Splunk.
408
+ // azure_dcr_immutable_id - string - Applicable only for destination type: azure. Immutable ID of the Data Collection Rule.
409
+ // azure_stream_name - string - Applicable only for destination type: azure. Name of the stream in the DCR that represents the destination table.
410
+ // azure_oauth_client_credentials_tenant_id - string - Applicable only for destination type: azure. Client Credentials OAuth Tenant ID.
411
+ // azure_oauth_client_credentials_client_id - string - Applicable only for destination type: azure. Client Credentials OAuth Client ID.
412
+ // azure_oauth_client_credentials_client_secret - string - Applicable only for destination type: azure. Client Credentials OAuth Client Secret.
413
+ // qradar_username - string - Applicable only for destination type: qradar. Basic auth username provided by QRadar.
414
+ // qradar_password - string - Applicable only for destination type: qradar. Basic auth password provided by QRadar.
415
+ // solar_winds_token - string - Applicable only for destination type: solar_winds. Authentication token provided by Solar Winds.
416
+ // new_relic_api_key - string - Applicable only for destination type: new_relic. API key provided by New Relic.
417
+ // datadog_api_key - string - Applicable only for destination type: datadog. API key provided by Datadog.
418
+ // sftp_action_send_enabled - boolean - Whether or not sending is enabled for sftp_action logs.
419
+ // ftp_action_send_enabled - boolean - Whether or not sending is enabled for ftp_action logs.
420
+ // web_dav_action_send_enabled - boolean - Whether or not sending is enabled for web_dav_action logs.
421
+ // sync_send_enabled - boolean - Whether or not sending is enabled for sync logs.
422
+ // outbound_connection_send_enabled - boolean - Whether or not sending is enabled for outbound_connection logs.
423
+ // automation_send_enabled - boolean - Whether or not sending is enabled for automation logs.
424
+ // api_request_send_enabled - boolean - Whether or not sending is enabled for api_request logs.
425
+ // public_hosting_request_send_enabled - boolean - Whether or not sending is enabled for public_hosting_request logs.
426
+ // email_send_enabled - boolean - Whether or not sending is enabled for email logs.
427
+ // exavault_api_request_send_enabled - boolean - Whether or not sending is enabled for exavault_api_request logs.
428
+ // destination_type - string - Destination Type
429
+ // destination_url - string - Destination Url
430
+ update = async (params = {}) => {
431
+ if (!this.attributes.id) {
432
+ throw new errors.EmptyPropertyError('Current object has no id')
433
+ }
434
+
435
+ if (!isObject(params)) {
436
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
437
+ }
438
+
439
+ params.id = this.attributes.id
440
+ if (params.id && !isInt(params.id)) {
441
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
442
+ }
443
+
444
+ if (params.name && !isString(params.name)) {
445
+ throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
446
+ }
447
+
448
+ if (params.generic_payload_type && !isString(params.generic_payload_type)) {
449
+ throw new errors.InvalidParameterError(`Bad parameter: generic_payload_type must be of type String, received ${getType(params.generic_payload_type)}`)
450
+ }
451
+
452
+ if (params.splunk_token && !isString(params.splunk_token)) {
453
+ throw new errors.InvalidParameterError(`Bad parameter: splunk_token must be of type String, received ${getType(params.splunk_token)}`)
454
+ }
455
+
456
+ if (params.azure_dcr_immutable_id && !isString(params.azure_dcr_immutable_id)) {
457
+ throw new errors.InvalidParameterError(`Bad parameter: azure_dcr_immutable_id must be of type String, received ${getType(params.azure_dcr_immutable_id)}`)
458
+ }
459
+
460
+ if (params.azure_stream_name && !isString(params.azure_stream_name)) {
461
+ throw new errors.InvalidParameterError(`Bad parameter: azure_stream_name must be of type String, received ${getType(params.azure_stream_name)}`)
462
+ }
463
+
464
+ if (params.azure_oauth_client_credentials_tenant_id && !isString(params.azure_oauth_client_credentials_tenant_id)) {
465
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_tenant_id must be of type String, received ${getType(params.azure_oauth_client_credentials_tenant_id)}`)
466
+ }
467
+
468
+ if (params.azure_oauth_client_credentials_client_id && !isString(params.azure_oauth_client_credentials_client_id)) {
469
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_id must be of type String, received ${getType(params.azure_oauth_client_credentials_client_id)}`)
470
+ }
471
+
472
+ if (params.azure_oauth_client_credentials_client_secret && !isString(params.azure_oauth_client_credentials_client_secret)) {
473
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_secret must be of type String, received ${getType(params.azure_oauth_client_credentials_client_secret)}`)
474
+ }
475
+
476
+ if (params.qradar_username && !isString(params.qradar_username)) {
477
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_username must be of type String, received ${getType(params.qradar_username)}`)
478
+ }
479
+
480
+ if (params.qradar_password && !isString(params.qradar_password)) {
481
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_password must be of type String, received ${getType(params.qradar_password)}`)
482
+ }
483
+
484
+ if (params.solar_winds_token && !isString(params.solar_winds_token)) {
485
+ throw new errors.InvalidParameterError(`Bad parameter: solar_winds_token must be of type String, received ${getType(params.solar_winds_token)}`)
486
+ }
487
+
488
+ if (params.new_relic_api_key && !isString(params.new_relic_api_key)) {
489
+ throw new errors.InvalidParameterError(`Bad parameter: new_relic_api_key must be of type String, received ${getType(params.new_relic_api_key)}`)
490
+ }
491
+
492
+ if (params.datadog_api_key && !isString(params.datadog_api_key)) {
493
+ throw new errors.InvalidParameterError(`Bad parameter: datadog_api_key must be of type String, received ${getType(params.datadog_api_key)}`)
494
+ }
495
+
496
+ if (params.destination_type && !isString(params.destination_type)) {
497
+ throw new errors.InvalidParameterError(`Bad parameter: destination_type must be of type String, received ${getType(params.destination_type)}`)
498
+ }
499
+
500
+ if (params.destination_url && !isString(params.destination_url)) {
501
+ throw new errors.InvalidParameterError(`Bad parameter: destination_url must be of type String, received ${getType(params.destination_url)}`)
502
+ }
503
+
504
+ if (!params.id) {
505
+ if (this.attributes.id) {
506
+ params.id = this.id
507
+ } else {
508
+ throw new errors.MissingParameterError('Parameter missing: id')
509
+ }
510
+ }
511
+
512
+ const response = await Api.sendRequest(`/siem_http_destinations/${encodeURIComponent(params.id)}`, 'PATCH', params, this.options)
513
+
514
+ return new SiemHttpDestination(response?.data, this.options)
515
+ }
516
+
517
+ delete = async (params = {}) => {
518
+ if (!this.attributes.id) {
519
+ throw new errors.EmptyPropertyError('Current object has no id')
520
+ }
521
+
522
+ if (!isObject(params)) {
523
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
524
+ }
525
+
526
+ params.id = this.attributes.id
527
+ if (params.id && !isInt(params.id)) {
528
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
529
+ }
530
+
531
+ if (!params.id) {
532
+ if (this.attributes.id) {
533
+ params.id = this.id
534
+ } else {
535
+ throw new errors.MissingParameterError('Parameter missing: id')
536
+ }
537
+ }
538
+
539
+ await Api.sendRequest(`/siem_http_destinations/${encodeURIComponent(params.id)}`, 'DELETE', params, this.options)
540
+ }
541
+
542
+ destroy = (params = {}) =>
543
+ this.delete(params)
544
+
545
+ save = async () => {
546
+ if (this.attributes.id) {
547
+ const newObject = await this.update(this.attributes)
548
+ this.attributes = { ...newObject.attributes }
549
+ return true
550
+ }
551
+
552
+ const newObject = await SiemHttpDestination.create(this.attributes, this.options)
553
+ this.attributes = { ...newObject.attributes }
554
+ return true
555
+ }
556
+
557
+ // Parameters:
558
+ // 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.
559
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
560
+ static list = async (params = {}, options = {}) => {
561
+ if (params.cursor && !isString(params.cursor)) {
562
+ throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
563
+ }
564
+
565
+ if (params.per_page && !isInt(params.per_page)) {
566
+ throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
567
+ }
568
+
569
+ const response = await Api.sendRequest('/siem_http_destinations', 'GET', params, options)
570
+
571
+ return response?.data?.map(obj => new SiemHttpDestination(obj, options)) || []
572
+ }
573
+
574
+ static all = (params = {}, options = {}) =>
575
+ SiemHttpDestination.list(params, options)
576
+
577
+ // Parameters:
578
+ // id (required) - int64 - Siem Http Destination ID.
579
+ static find = async (id, params = {}, options = {}) => {
580
+ if (!isObject(params)) {
581
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
582
+ }
583
+
584
+ params.id = id
585
+
586
+ if (!params.id) {
587
+ throw new errors.MissingParameterError('Parameter missing: id')
588
+ }
589
+
590
+ if (params.id && !isInt(params.id)) {
591
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
592
+ }
593
+
594
+ const response = await Api.sendRequest(`/siem_http_destinations/${encodeURIComponent(params.id)}`, 'GET', params, options)
595
+
596
+ return new SiemHttpDestination(response?.data, options)
597
+ }
598
+
599
+ static get = (id, params = {}, options = {}) =>
600
+ SiemHttpDestination.find(id, params, options)
601
+
602
+ // Parameters:
603
+ // name - string - Name for this Destination
604
+ // additional_headers - object - Additional HTTP Headers included in calls to the destination URL
605
+ // sending_active - boolean - Whether this SIEM HTTP Destination is currently being sent to or not
606
+ // generic_payload_type - string - Applicable only for destination type: generic. Indicates the type of HTTP body. Can be json_newline or json_array. json_newline is multiple log entries as JSON separated by newlines. json_array is a single JSON array containing multiple log entries as JSON.
607
+ // splunk_token - string - Applicable only for destination type: splunk. Authentication token provided by Splunk.
608
+ // azure_dcr_immutable_id - string - Applicable only for destination type: azure. Immutable ID of the Data Collection Rule.
609
+ // azure_stream_name - string - Applicable only for destination type: azure. Name of the stream in the DCR that represents the destination table.
610
+ // azure_oauth_client_credentials_tenant_id - string - Applicable only for destination type: azure. Client Credentials OAuth Tenant ID.
611
+ // azure_oauth_client_credentials_client_id - string - Applicable only for destination type: azure. Client Credentials OAuth Client ID.
612
+ // azure_oauth_client_credentials_client_secret - string - Applicable only for destination type: azure. Client Credentials OAuth Client Secret.
613
+ // qradar_username - string - Applicable only for destination type: qradar. Basic auth username provided by QRadar.
614
+ // qradar_password - string - Applicable only for destination type: qradar. Basic auth password provided by QRadar.
615
+ // solar_winds_token - string - Applicable only for destination type: solar_winds. Authentication token provided by Solar Winds.
616
+ // new_relic_api_key - string - Applicable only for destination type: new_relic. API key provided by New Relic.
617
+ // datadog_api_key - string - Applicable only for destination type: datadog. API key provided by Datadog.
618
+ // sftp_action_send_enabled - boolean - Whether or not sending is enabled for sftp_action logs.
619
+ // ftp_action_send_enabled - boolean - Whether or not sending is enabled for ftp_action logs.
620
+ // web_dav_action_send_enabled - boolean - Whether or not sending is enabled for web_dav_action logs.
621
+ // sync_send_enabled - boolean - Whether or not sending is enabled for sync logs.
622
+ // outbound_connection_send_enabled - boolean - Whether or not sending is enabled for outbound_connection logs.
623
+ // automation_send_enabled - boolean - Whether or not sending is enabled for automation logs.
624
+ // api_request_send_enabled - boolean - Whether or not sending is enabled for api_request logs.
625
+ // public_hosting_request_send_enabled - boolean - Whether or not sending is enabled for public_hosting_request logs.
626
+ // email_send_enabled - boolean - Whether or not sending is enabled for email logs.
627
+ // exavault_api_request_send_enabled - boolean - Whether or not sending is enabled for exavault_api_request logs.
628
+ // destination_type (required) - string - Destination Type
629
+ // destination_url (required) - string - Destination Url
630
+ static create = async (params = {}, options = {}) => {
631
+ if (!params.destination_type) {
632
+ throw new errors.MissingParameterError('Parameter missing: destination_type')
633
+ }
634
+
635
+ if (!params.destination_url) {
636
+ throw new errors.MissingParameterError('Parameter missing: destination_url')
637
+ }
638
+
639
+ if (params.name && !isString(params.name)) {
640
+ throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
641
+ }
642
+
643
+ if (params.generic_payload_type && !isString(params.generic_payload_type)) {
644
+ throw new errors.InvalidParameterError(`Bad parameter: generic_payload_type must be of type String, received ${getType(params.generic_payload_type)}`)
645
+ }
646
+
647
+ if (params.splunk_token && !isString(params.splunk_token)) {
648
+ throw new errors.InvalidParameterError(`Bad parameter: splunk_token must be of type String, received ${getType(params.splunk_token)}`)
649
+ }
650
+
651
+ if (params.azure_dcr_immutable_id && !isString(params.azure_dcr_immutable_id)) {
652
+ throw new errors.InvalidParameterError(`Bad parameter: azure_dcr_immutable_id must be of type String, received ${getType(params.azure_dcr_immutable_id)}`)
653
+ }
654
+
655
+ if (params.azure_stream_name && !isString(params.azure_stream_name)) {
656
+ throw new errors.InvalidParameterError(`Bad parameter: azure_stream_name must be of type String, received ${getType(params.azure_stream_name)}`)
657
+ }
658
+
659
+ if (params.azure_oauth_client_credentials_tenant_id && !isString(params.azure_oauth_client_credentials_tenant_id)) {
660
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_tenant_id must be of type String, received ${getType(params.azure_oauth_client_credentials_tenant_id)}`)
661
+ }
662
+
663
+ if (params.azure_oauth_client_credentials_client_id && !isString(params.azure_oauth_client_credentials_client_id)) {
664
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_id must be of type String, received ${getType(params.azure_oauth_client_credentials_client_id)}`)
665
+ }
666
+
667
+ if (params.azure_oauth_client_credentials_client_secret && !isString(params.azure_oauth_client_credentials_client_secret)) {
668
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_secret must be of type String, received ${getType(params.azure_oauth_client_credentials_client_secret)}`)
669
+ }
670
+
671
+ if (params.qradar_username && !isString(params.qradar_username)) {
672
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_username must be of type String, received ${getType(params.qradar_username)}`)
673
+ }
674
+
675
+ if (params.qradar_password && !isString(params.qradar_password)) {
676
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_password must be of type String, received ${getType(params.qradar_password)}`)
677
+ }
678
+
679
+ if (params.solar_winds_token && !isString(params.solar_winds_token)) {
680
+ throw new errors.InvalidParameterError(`Bad parameter: solar_winds_token must be of type String, received ${getType(params.solar_winds_token)}`)
681
+ }
682
+
683
+ if (params.new_relic_api_key && !isString(params.new_relic_api_key)) {
684
+ throw new errors.InvalidParameterError(`Bad parameter: new_relic_api_key must be of type String, received ${getType(params.new_relic_api_key)}`)
685
+ }
686
+
687
+ if (params.datadog_api_key && !isString(params.datadog_api_key)) {
688
+ throw new errors.InvalidParameterError(`Bad parameter: datadog_api_key must be of type String, received ${getType(params.datadog_api_key)}`)
689
+ }
690
+
691
+ if (params.destination_type && !isString(params.destination_type)) {
692
+ throw new errors.InvalidParameterError(`Bad parameter: destination_type must be of type String, received ${getType(params.destination_type)}`)
693
+ }
694
+
695
+ if (params.destination_url && !isString(params.destination_url)) {
696
+ throw new errors.InvalidParameterError(`Bad parameter: destination_url must be of type String, received ${getType(params.destination_url)}`)
697
+ }
698
+
699
+ const response = await Api.sendRequest('/siem_http_destinations', 'POST', params, options)
700
+
701
+ return new SiemHttpDestination(response?.data, options)
702
+ }
703
+
704
+ // Parameters:
705
+ // siem_http_destination_id - int64 - SIEM HTTP Destination ID
706
+ // destination_type - string - Destination Type
707
+ // destination_url - string - Destination Url
708
+ // name - string - Name for this Destination
709
+ // additional_headers - object - Additional HTTP Headers included in calls to the destination URL
710
+ // sending_active - boolean - Whether this SIEM HTTP Destination is currently being sent to or not
711
+ // generic_payload_type - string - Applicable only for destination type: generic. Indicates the type of HTTP body. Can be json_newline or json_array. json_newline is multiple log entries as JSON separated by newlines. json_array is a single JSON array containing multiple log entries as JSON.
712
+ // splunk_token - string - Applicable only for destination type: splunk. Authentication token provided by Splunk.
713
+ // azure_dcr_immutable_id - string - Applicable only for destination type: azure. Immutable ID of the Data Collection Rule.
714
+ // azure_stream_name - string - Applicable only for destination type: azure. Name of the stream in the DCR that represents the destination table.
715
+ // azure_oauth_client_credentials_tenant_id - string - Applicable only for destination type: azure. Client Credentials OAuth Tenant ID.
716
+ // azure_oauth_client_credentials_client_id - string - Applicable only for destination type: azure. Client Credentials OAuth Client ID.
717
+ // azure_oauth_client_credentials_client_secret - string - Applicable only for destination type: azure. Client Credentials OAuth Client Secret.
718
+ // qradar_username - string - Applicable only for destination type: qradar. Basic auth username provided by QRadar.
719
+ // qradar_password - string - Applicable only for destination type: qradar. Basic auth password provided by QRadar.
720
+ // solar_winds_token - string - Applicable only for destination type: solar_winds. Authentication token provided by Solar Winds.
721
+ // new_relic_api_key - string - Applicable only for destination type: new_relic. API key provided by New Relic.
722
+ // datadog_api_key - string - Applicable only for destination type: datadog. API key provided by Datadog.
723
+ // sftp_action_send_enabled - boolean - Whether or not sending is enabled for sftp_action logs.
724
+ // ftp_action_send_enabled - boolean - Whether or not sending is enabled for ftp_action logs.
725
+ // web_dav_action_send_enabled - boolean - Whether or not sending is enabled for web_dav_action logs.
726
+ // sync_send_enabled - boolean - Whether or not sending is enabled for sync logs.
727
+ // outbound_connection_send_enabled - boolean - Whether or not sending is enabled for outbound_connection logs.
728
+ // automation_send_enabled - boolean - Whether or not sending is enabled for automation logs.
729
+ // api_request_send_enabled - boolean - Whether or not sending is enabled for api_request logs.
730
+ // public_hosting_request_send_enabled - boolean - Whether or not sending is enabled for public_hosting_request logs.
731
+ // email_send_enabled - boolean - Whether or not sending is enabled for email logs.
732
+ // exavault_api_request_send_enabled - boolean - Whether or not sending is enabled for exavault_api_request logs.
733
+ static sendTestEntry = async (params = {}, options = {}) => {
734
+ if (params.siem_http_destination_id && !isInt(params.siem_http_destination_id)) {
735
+ throw new errors.InvalidParameterError(`Bad parameter: siem_http_destination_id must be of type Int, received ${getType(params.siem_http_destination_id)}`)
736
+ }
737
+
738
+ if (params.destination_type && !isString(params.destination_type)) {
739
+ throw new errors.InvalidParameterError(`Bad parameter: destination_type must be of type String, received ${getType(params.destination_type)}`)
740
+ }
741
+
742
+ if (params.destination_url && !isString(params.destination_url)) {
743
+ throw new errors.InvalidParameterError(`Bad parameter: destination_url must be of type String, received ${getType(params.destination_url)}`)
744
+ }
745
+
746
+ if (params.name && !isString(params.name)) {
747
+ throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
748
+ }
749
+
750
+ if (params.generic_payload_type && !isString(params.generic_payload_type)) {
751
+ throw new errors.InvalidParameterError(`Bad parameter: generic_payload_type must be of type String, received ${getType(params.generic_payload_type)}`)
752
+ }
753
+
754
+ if (params.splunk_token && !isString(params.splunk_token)) {
755
+ throw new errors.InvalidParameterError(`Bad parameter: splunk_token must be of type String, received ${getType(params.splunk_token)}`)
756
+ }
757
+
758
+ if (params.azure_dcr_immutable_id && !isString(params.azure_dcr_immutable_id)) {
759
+ throw new errors.InvalidParameterError(`Bad parameter: azure_dcr_immutable_id must be of type String, received ${getType(params.azure_dcr_immutable_id)}`)
760
+ }
761
+
762
+ if (params.azure_stream_name && !isString(params.azure_stream_name)) {
763
+ throw new errors.InvalidParameterError(`Bad parameter: azure_stream_name must be of type String, received ${getType(params.azure_stream_name)}`)
764
+ }
765
+
766
+ if (params.azure_oauth_client_credentials_tenant_id && !isString(params.azure_oauth_client_credentials_tenant_id)) {
767
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_tenant_id must be of type String, received ${getType(params.azure_oauth_client_credentials_tenant_id)}`)
768
+ }
769
+
770
+ if (params.azure_oauth_client_credentials_client_id && !isString(params.azure_oauth_client_credentials_client_id)) {
771
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_id must be of type String, received ${getType(params.azure_oauth_client_credentials_client_id)}`)
772
+ }
773
+
774
+ if (params.azure_oauth_client_credentials_client_secret && !isString(params.azure_oauth_client_credentials_client_secret)) {
775
+ throw new errors.InvalidParameterError(`Bad parameter: azure_oauth_client_credentials_client_secret must be of type String, received ${getType(params.azure_oauth_client_credentials_client_secret)}`)
776
+ }
777
+
778
+ if (params.qradar_username && !isString(params.qradar_username)) {
779
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_username must be of type String, received ${getType(params.qradar_username)}`)
780
+ }
781
+
782
+ if (params.qradar_password && !isString(params.qradar_password)) {
783
+ throw new errors.InvalidParameterError(`Bad parameter: qradar_password must be of type String, received ${getType(params.qradar_password)}`)
784
+ }
785
+
786
+ if (params.solar_winds_token && !isString(params.solar_winds_token)) {
787
+ throw new errors.InvalidParameterError(`Bad parameter: solar_winds_token must be of type String, received ${getType(params.solar_winds_token)}`)
788
+ }
789
+
790
+ if (params.new_relic_api_key && !isString(params.new_relic_api_key)) {
791
+ throw new errors.InvalidParameterError(`Bad parameter: new_relic_api_key must be of type String, received ${getType(params.new_relic_api_key)}`)
792
+ }
793
+
794
+ if (params.datadog_api_key && !isString(params.datadog_api_key)) {
795
+ throw new errors.InvalidParameterError(`Bad parameter: datadog_api_key must be of type String, received ${getType(params.datadog_api_key)}`)
796
+ }
797
+
798
+ await Api.sendRequest('/siem_http_destinations/send_test_entry', 'POST', params, options)
799
+ }
800
+ }
801
+
802
+ export default SiemHttpDestination
803
+
804
+ module.exports = SiemHttpDestination
805
+ module.exports.default = SiemHttpDestination