@alicloud/cloud-siem20220616 1.0.0

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.
package/src/client.ts ADDED
@@ -0,0 +1,604 @@
1
+ // This file is auto-generated, don't edit it
2
+ /**
3
+ *
4
+ */
5
+ import Util, * as $Util from '@alicloud/tea-util';
6
+ import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
7
+ import OpenApiUtil from '@alicloud/openapi-util';
8
+ import EndpointUtil from '@alicloud/endpoint-util';
9
+ import * as $tea from '@alicloud/tea-typescript';
10
+
11
+ export class BatchJobCheckRequest extends $tea.Model {
12
+ regionId?: string;
13
+ submitId?: string;
14
+ static names(): { [key: string]: string } {
15
+ return {
16
+ regionId: 'RegionId',
17
+ submitId: 'SubmitId',
18
+ };
19
+ }
20
+
21
+ static types(): { [key: string]: any } {
22
+ return {
23
+ regionId: 'string',
24
+ submitId: 'string',
25
+ };
26
+ }
27
+
28
+ constructor(map?: { [key: string]: any }) {
29
+ super(map);
30
+ }
31
+ }
32
+
33
+ export class BatchJobCheckResponseBody extends $tea.Model {
34
+ code?: number;
35
+ data?: BatchJobCheckResponseBodyData;
36
+ errCode?: string;
37
+ message?: string;
38
+ requestId?: string;
39
+ success?: boolean;
40
+ static names(): { [key: string]: string } {
41
+ return {
42
+ code: 'Code',
43
+ data: 'Data',
44
+ errCode: 'ErrCode',
45
+ message: 'Message',
46
+ requestId: 'RequestId',
47
+ success: 'Success',
48
+ };
49
+ }
50
+
51
+ static types(): { [key: string]: any } {
52
+ return {
53
+ code: 'number',
54
+ data: BatchJobCheckResponseBodyData,
55
+ errCode: 'string',
56
+ message: 'string',
57
+ requestId: 'string',
58
+ success: 'boolean',
59
+ };
60
+ }
61
+
62
+ constructor(map?: { [key: string]: any }) {
63
+ super(map);
64
+ }
65
+ }
66
+
67
+ export class BatchJobCheckResponse extends $tea.Model {
68
+ headers: { [key: string]: string };
69
+ statusCode: number;
70
+ body: BatchJobCheckResponseBody;
71
+ static names(): { [key: string]: string } {
72
+ return {
73
+ headers: 'headers',
74
+ statusCode: 'statusCode',
75
+ body: 'body',
76
+ };
77
+ }
78
+
79
+ static types(): { [key: string]: any } {
80
+ return {
81
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
82
+ statusCode: 'number',
83
+ body: BatchJobCheckResponseBody,
84
+ };
85
+ }
86
+
87
+ constructor(map?: { [key: string]: any }) {
88
+ super(map);
89
+ }
90
+ }
91
+
92
+ export class BatchJobSubmitRequest extends $tea.Model {
93
+ jsonConfig?: string;
94
+ regionId?: string;
95
+ static names(): { [key: string]: string } {
96
+ return {
97
+ jsonConfig: 'JsonConfig',
98
+ regionId: 'RegionId',
99
+ };
100
+ }
101
+
102
+ static types(): { [key: string]: any } {
103
+ return {
104
+ jsonConfig: 'string',
105
+ regionId: 'string',
106
+ };
107
+ }
108
+
109
+ constructor(map?: { [key: string]: any }) {
110
+ super(map);
111
+ }
112
+ }
113
+
114
+ export class BatchJobSubmitResponseBody extends $tea.Model {
115
+ code?: number;
116
+ data?: BatchJobSubmitResponseBodyData;
117
+ errCode?: string;
118
+ message?: string;
119
+ requestId?: string;
120
+ success?: boolean;
121
+ static names(): { [key: string]: string } {
122
+ return {
123
+ code: 'Code',
124
+ data: 'Data',
125
+ errCode: 'ErrCode',
126
+ message: 'Message',
127
+ requestId: 'RequestId',
128
+ success: 'Success',
129
+ };
130
+ }
131
+
132
+ static types(): { [key: string]: any } {
133
+ return {
134
+ code: 'number',
135
+ data: BatchJobSubmitResponseBodyData,
136
+ errCode: 'string',
137
+ message: 'string',
138
+ requestId: 'string',
139
+ success: 'boolean',
140
+ };
141
+ }
142
+
143
+ constructor(map?: { [key: string]: any }) {
144
+ super(map);
145
+ }
146
+ }
147
+
148
+ export class BatchJobSubmitResponse extends $tea.Model {
149
+ headers: { [key: string]: string };
150
+ statusCode: number;
151
+ body: BatchJobSubmitResponseBody;
152
+ static names(): { [key: string]: string } {
153
+ return {
154
+ headers: 'headers',
155
+ statusCode: 'statusCode',
156
+ body: 'body',
157
+ };
158
+ }
159
+
160
+ static types(): { [key: string]: any } {
161
+ return {
162
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
163
+ statusCode: 'number',
164
+ body: BatchJobSubmitResponseBody,
165
+ };
166
+ }
167
+
168
+ constructor(map?: { [key: string]: any }) {
169
+ super(map);
170
+ }
171
+ }
172
+
173
+ export class SendMessageRequest extends $tea.Model {
174
+ channelType?: number;
175
+ receiveUid?: number;
176
+ regionId?: string;
177
+ static names(): { [key: string]: string } {
178
+ return {
179
+ channelType: 'ChannelType',
180
+ receiveUid: 'ReceiveUid',
181
+ regionId: 'RegionId',
182
+ };
183
+ }
184
+
185
+ static types(): { [key: string]: any } {
186
+ return {
187
+ channelType: 'number',
188
+ receiveUid: 'number',
189
+ regionId: 'string',
190
+ };
191
+ }
192
+
193
+ constructor(map?: { [key: string]: any }) {
194
+ super(map);
195
+ }
196
+ }
197
+
198
+ export class SendMessageResponseBody extends $tea.Model {
199
+ code?: number;
200
+ data?: boolean;
201
+ errCode?: string;
202
+ message?: string;
203
+ requestId?: string;
204
+ success?: boolean;
205
+ static names(): { [key: string]: string } {
206
+ return {
207
+ code: 'Code',
208
+ data: 'Data',
209
+ errCode: 'ErrCode',
210
+ message: 'Message',
211
+ requestId: 'RequestId',
212
+ success: 'Success',
213
+ };
214
+ }
215
+
216
+ static types(): { [key: string]: any } {
217
+ return {
218
+ code: 'number',
219
+ data: 'boolean',
220
+ errCode: 'string',
221
+ message: 'string',
222
+ requestId: 'string',
223
+ success: 'boolean',
224
+ };
225
+ }
226
+
227
+ constructor(map?: { [key: string]: any }) {
228
+ super(map);
229
+ }
230
+ }
231
+
232
+ export class SendMessageResponse extends $tea.Model {
233
+ headers: { [key: string]: string };
234
+ statusCode: number;
235
+ body: SendMessageResponseBody;
236
+ static names(): { [key: string]: string } {
237
+ return {
238
+ headers: 'headers',
239
+ statusCode: 'statusCode',
240
+ body: 'body',
241
+ };
242
+ }
243
+
244
+ static types(): { [key: string]: any } {
245
+ return {
246
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
247
+ statusCode: 'number',
248
+ body: SendMessageResponseBody,
249
+ };
250
+ }
251
+
252
+ constructor(map?: { [key: string]: any }) {
253
+ super(map);
254
+ }
255
+ }
256
+
257
+ export class BatchJobCheckResponseBodyDataErrTaskListProductListLogList extends $tea.Model {
258
+ errorCode?: string;
259
+ logCode?: string;
260
+ logStoreNamePattern?: string;
261
+ productCode?: string;
262
+ projectNamePattern?: string;
263
+ regionCode?: string;
264
+ static names(): { [key: string]: string } {
265
+ return {
266
+ errorCode: 'ErrorCode',
267
+ logCode: 'LogCode',
268
+ logStoreNamePattern: 'LogStoreNamePattern',
269
+ productCode: 'ProductCode',
270
+ projectNamePattern: 'ProjectNamePattern',
271
+ regionCode: 'RegionCode',
272
+ };
273
+ }
274
+
275
+ static types(): { [key: string]: any } {
276
+ return {
277
+ errorCode: 'string',
278
+ logCode: 'string',
279
+ logStoreNamePattern: 'string',
280
+ productCode: 'string',
281
+ projectNamePattern: 'string',
282
+ regionCode: 'string',
283
+ };
284
+ }
285
+
286
+ constructor(map?: { [key: string]: any }) {
287
+ super(map);
288
+ }
289
+ }
290
+
291
+ export class BatchJobCheckResponseBodyDataErrTaskListProductList extends $tea.Model {
292
+ logList?: BatchJobCheckResponseBodyDataErrTaskListProductListLogList[];
293
+ productCode?: string;
294
+ static names(): { [key: string]: string } {
295
+ return {
296
+ logList: 'LogList',
297
+ productCode: 'ProductCode',
298
+ };
299
+ }
300
+
301
+ static types(): { [key: string]: any } {
302
+ return {
303
+ logList: { 'type': 'array', 'itemType': BatchJobCheckResponseBodyDataErrTaskListProductListLogList },
304
+ productCode: 'string',
305
+ };
306
+ }
307
+
308
+ constructor(map?: { [key: string]: any }) {
309
+ super(map);
310
+ }
311
+ }
312
+
313
+ export class BatchJobCheckResponseBodyDataErrTaskList extends $tea.Model {
314
+ productList?: BatchJobCheckResponseBodyDataErrTaskListProductList[];
315
+ userId?: number;
316
+ static names(): { [key: string]: string } {
317
+ return {
318
+ productList: 'ProductList',
319
+ userId: 'UserId',
320
+ };
321
+ }
322
+
323
+ static types(): { [key: string]: any } {
324
+ return {
325
+ productList: { 'type': 'array', 'itemType': BatchJobCheckResponseBodyDataErrTaskListProductList },
326
+ userId: 'number',
327
+ };
328
+ }
329
+
330
+ constructor(map?: { [key: string]: any }) {
331
+ super(map);
332
+ }
333
+ }
334
+
335
+ export class BatchJobCheckResponseBodyData extends $tea.Model {
336
+ configId?: string;
337
+ errTaskList?: BatchJobCheckResponseBodyDataErrTaskList[];
338
+ failedCount?: number;
339
+ finishCount?: number;
340
+ folderId?: string;
341
+ taskCount?: number;
342
+ taskStatus?: string;
343
+ static names(): { [key: string]: string } {
344
+ return {
345
+ configId: 'ConfigId',
346
+ errTaskList: 'ErrTaskList',
347
+ failedCount: 'FailedCount',
348
+ finishCount: 'FinishCount',
349
+ folderId: 'FolderId',
350
+ taskCount: 'TaskCount',
351
+ taskStatus: 'TaskStatus',
352
+ };
353
+ }
354
+
355
+ static types(): { [key: string]: any } {
356
+ return {
357
+ configId: 'string',
358
+ errTaskList: { 'type': 'array', 'itemType': BatchJobCheckResponseBodyDataErrTaskList },
359
+ failedCount: 'number',
360
+ finishCount: 'number',
361
+ folderId: 'string',
362
+ taskCount: 'number',
363
+ taskStatus: 'string',
364
+ };
365
+ }
366
+
367
+ constructor(map?: { [key: string]: any }) {
368
+ super(map);
369
+ }
370
+ }
371
+
372
+ export class BatchJobSubmitResponseBodyDataConfigListProductListLogList extends $tea.Model {
373
+ errorCode?: string;
374
+ logCode?: string;
375
+ logStoreNamePattern?: string;
376
+ productCode?: string;
377
+ projectNamePattern?: string;
378
+ regionCode?: string;
379
+ static names(): { [key: string]: string } {
380
+ return {
381
+ errorCode: 'ErrorCode',
382
+ logCode: 'LogCode',
383
+ logStoreNamePattern: 'LogStoreNamePattern',
384
+ productCode: 'ProductCode',
385
+ projectNamePattern: 'ProjectNamePattern',
386
+ regionCode: 'RegionCode',
387
+ };
388
+ }
389
+
390
+ static types(): { [key: string]: any } {
391
+ return {
392
+ errorCode: 'string',
393
+ logCode: 'string',
394
+ logStoreNamePattern: 'string',
395
+ productCode: 'string',
396
+ projectNamePattern: 'string',
397
+ regionCode: 'string',
398
+ };
399
+ }
400
+
401
+ constructor(map?: { [key: string]: any }) {
402
+ super(map);
403
+ }
404
+ }
405
+
406
+ export class BatchJobSubmitResponseBodyDataConfigListProductList extends $tea.Model {
407
+ logList?: BatchJobSubmitResponseBodyDataConfigListProductListLogList[];
408
+ productCode?: string;
409
+ static names(): { [key: string]: string } {
410
+ return {
411
+ logList: 'LogList',
412
+ productCode: 'ProductCode',
413
+ };
414
+ }
415
+
416
+ static types(): { [key: string]: any } {
417
+ return {
418
+ logList: { 'type': 'array', 'itemType': BatchJobSubmitResponseBodyDataConfigListProductListLogList },
419
+ productCode: 'string',
420
+ };
421
+ }
422
+
423
+ constructor(map?: { [key: string]: any }) {
424
+ super(map);
425
+ }
426
+ }
427
+
428
+ export class BatchJobSubmitResponseBodyDataConfigList extends $tea.Model {
429
+ productList?: BatchJobSubmitResponseBodyDataConfigListProductList[];
430
+ userId?: number;
431
+ static names(): { [key: string]: string } {
432
+ return {
433
+ productList: 'ProductList',
434
+ userId: 'UserId',
435
+ };
436
+ }
437
+
438
+ static types(): { [key: string]: any } {
439
+ return {
440
+ productList: { 'type': 'array', 'itemType': BatchJobSubmitResponseBodyDataConfigListProductList },
441
+ userId: 'number',
442
+ };
443
+ }
444
+
445
+ constructor(map?: { [key: string]: any }) {
446
+ super(map);
447
+ }
448
+ }
449
+
450
+ export class BatchJobSubmitResponseBodyData extends $tea.Model {
451
+ configId?: string;
452
+ configList?: BatchJobSubmitResponseBodyDataConfigList[];
453
+ submitId?: string;
454
+ taskCount?: number;
455
+ static names(): { [key: string]: string } {
456
+ return {
457
+ configId: 'ConfigId',
458
+ configList: 'ConfigList',
459
+ submitId: 'SubmitId',
460
+ taskCount: 'TaskCount',
461
+ };
462
+ }
463
+
464
+ static types(): { [key: string]: any } {
465
+ return {
466
+ configId: 'string',
467
+ configList: { 'type': 'array', 'itemType': BatchJobSubmitResponseBodyDataConfigList },
468
+ submitId: 'string',
469
+ taskCount: 'number',
470
+ };
471
+ }
472
+
473
+ constructor(map?: { [key: string]: any }) {
474
+ super(map);
475
+ }
476
+ }
477
+
478
+
479
+ export default class Client extends OpenApi {
480
+
481
+ constructor(config: $OpenApi.Config) {
482
+ super(config);
483
+ this._endpointRule = "";
484
+ this.checkConfig(config);
485
+ this._endpoint = this.getEndpoint("cloud-siem", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint);
486
+ }
487
+
488
+
489
+ getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {[key: string ]: string}, endpoint: string): string {
490
+ if (!Util.empty(endpoint)) {
491
+ return endpoint;
492
+ }
493
+
494
+ if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
495
+ return endpointMap[regionId];
496
+ }
497
+
498
+ return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
499
+ }
500
+
501
+ async batchJobCheckWithOptions(request: BatchJobCheckRequest, runtime: $Util.RuntimeOptions): Promise<BatchJobCheckResponse> {
502
+ Util.validateModel(request);
503
+ let body : {[key: string ]: any} = { };
504
+ if (!Util.isUnset(request.regionId)) {
505
+ body["RegionId"] = request.regionId;
506
+ }
507
+
508
+ if (!Util.isUnset(request.submitId)) {
509
+ body["SubmitId"] = request.submitId;
510
+ }
511
+
512
+ let req = new $OpenApi.OpenApiRequest({
513
+ body: OpenApiUtil.parseToMap(body),
514
+ });
515
+ let params = new $OpenApi.Params({
516
+ action: "BatchJobCheck",
517
+ version: "2022-06-16",
518
+ protocol: "HTTPS",
519
+ pathname: "/",
520
+ method: "POST",
521
+ authType: "AK",
522
+ style: "RPC",
523
+ reqBodyType: "formData",
524
+ bodyType: "json",
525
+ });
526
+ return $tea.cast<BatchJobCheckResponse>(await this.callApi(params, req, runtime), new BatchJobCheckResponse({}));
527
+ }
528
+
529
+ async batchJobCheck(request: BatchJobCheckRequest): Promise<BatchJobCheckResponse> {
530
+ let runtime = new $Util.RuntimeOptions({ });
531
+ return await this.batchJobCheckWithOptions(request, runtime);
532
+ }
533
+
534
+ async batchJobSubmitWithOptions(request: BatchJobSubmitRequest, runtime: $Util.RuntimeOptions): Promise<BatchJobSubmitResponse> {
535
+ Util.validateModel(request);
536
+ let body : {[key: string ]: any} = { };
537
+ if (!Util.isUnset(request.jsonConfig)) {
538
+ body["JsonConfig"] = request.jsonConfig;
539
+ }
540
+
541
+ if (!Util.isUnset(request.regionId)) {
542
+ body["RegionId"] = request.regionId;
543
+ }
544
+
545
+ let req = new $OpenApi.OpenApiRequest({
546
+ body: OpenApiUtil.parseToMap(body),
547
+ });
548
+ let params = new $OpenApi.Params({
549
+ action: "BatchJobSubmit",
550
+ version: "2022-06-16",
551
+ protocol: "HTTPS",
552
+ pathname: "/",
553
+ method: "POST",
554
+ authType: "AK",
555
+ style: "RPC",
556
+ reqBodyType: "formData",
557
+ bodyType: "json",
558
+ });
559
+ return $tea.cast<BatchJobSubmitResponse>(await this.callApi(params, req, runtime), new BatchJobSubmitResponse({}));
560
+ }
561
+
562
+ async batchJobSubmit(request: BatchJobSubmitRequest): Promise<BatchJobSubmitResponse> {
563
+ let runtime = new $Util.RuntimeOptions({ });
564
+ return await this.batchJobSubmitWithOptions(request, runtime);
565
+ }
566
+
567
+ async sendMessageWithOptions(request: SendMessageRequest, runtime: $Util.RuntimeOptions): Promise<SendMessageResponse> {
568
+ Util.validateModel(request);
569
+ let body : {[key: string ]: any} = { };
570
+ if (!Util.isUnset(request.channelType)) {
571
+ body["ChannelType"] = request.channelType;
572
+ }
573
+
574
+ if (!Util.isUnset(request.receiveUid)) {
575
+ body["ReceiveUid"] = request.receiveUid;
576
+ }
577
+
578
+ if (!Util.isUnset(request.regionId)) {
579
+ body["RegionId"] = request.regionId;
580
+ }
581
+
582
+ let req = new $OpenApi.OpenApiRequest({
583
+ body: OpenApiUtil.parseToMap(body),
584
+ });
585
+ let params = new $OpenApi.Params({
586
+ action: "SendMessage",
587
+ version: "2022-06-16",
588
+ protocol: "HTTPS",
589
+ pathname: "/",
590
+ method: "POST",
591
+ authType: "AK",
592
+ style: "RPC",
593
+ reqBodyType: "formData",
594
+ bodyType: "json",
595
+ });
596
+ return $tea.cast<SendMessageResponse>(await this.callApi(params, req, runtime), new SendMessageResponse({}));
597
+ }
598
+
599
+ async sendMessage(request: SendMessageRequest): Promise<SendMessageResponse> {
600
+ let runtime = new $Util.RuntimeOptions({ });
601
+ return await this.sendMessageWithOptions(request, runtime);
602
+ }
603
+
604
+ }