revengai 1.89.4__py3-none-any.whl → 1.92.1__py3-none-any.whl

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.

Potentially problematic release.


This version of revengai might be problematic. Click here for more details.

@@ -1,609 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- RevEng.AI API
5
-
6
- RevEng.AI is Similarity Search Engine for executable binaries
7
-
8
- Generated by OpenAPI Generator (https://openapi-generator.tech)
9
-
10
- Do not edit the class manually.
11
- """ # noqa: E501
12
-
13
- import warnings
14
- from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
- from typing import Any, Dict, List, Optional, Tuple, Union
16
- from typing_extensions import Annotated
17
-
18
- from pydantic import Field, StrictInt, StrictStr
19
- from typing import Optional
20
- from typing_extensions import Annotated
21
- from revengai.models.base_response_function_analysis_threat_score_data import BaseResponseFunctionAnalysisThreatScoreData
22
- from revengai.models.base_response_function_threat_score import BaseResponseFunctionThreatScore
23
-
24
- from revengai.api_client import ApiClient, RequestSerialized
25
- from revengai.api_response import ApiResponse
26
- from revengai.rest import RESTResponseType
27
-
28
-
29
- class FunctionsThreatScoreApi:
30
- """NOTE: This class is auto generated by OpenAPI Generator
31
- Ref: https://openapi-generator.tech
32
-
33
- Do not edit the class manually.
34
- """
35
-
36
- def __init__(self, api_client=None) -> None:
37
- if api_client is None:
38
- api_client = ApiClient.get_default()
39
- self.api_client = api_client
40
-
41
-
42
- @validate_call
43
- def get_all_function_threat_scores(
44
- self,
45
- analysis_id: StrictInt,
46
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
47
- _request_timeout: Union[
48
- None,
49
- Annotated[StrictFloat, Field(gt=0)],
50
- Tuple[
51
- Annotated[StrictFloat, Field(gt=0)],
52
- Annotated[StrictFloat, Field(gt=0)]
53
- ]
54
- ] = None,
55
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
- _content_type: Optional[StrictStr] = None,
57
- _headers: Optional[Dict[StrictStr, Any]] = None,
58
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
- ) -> BaseResponseFunctionThreatScore:
60
- """Gets the threat score for all functions
61
-
62
- Calculates the threat score for all functions inside of an analysis
63
-
64
- :param analysis_id: (required)
65
- :type analysis_id: int
66
- :param authorization: API Key bearer token
67
- :type authorization: str
68
- :param _request_timeout: timeout setting for this request. If one
69
- number provided, it will be total request
70
- timeout. It can also be a pair (tuple) of
71
- (connection, read) timeouts.
72
- :type _request_timeout: int, tuple(int, int), optional
73
- :param _request_auth: set to override the auth_settings for an a single
74
- request; this effectively ignores the
75
- authentication in the spec for a single request.
76
- :type _request_auth: dict, optional
77
- :param _content_type: force content-type for the request.
78
- :type _content_type: str, Optional
79
- :param _headers: set to override the headers for a single
80
- request; this effectively ignores the headers
81
- in the spec for a single request.
82
- :type _headers: dict, optional
83
- :param _host_index: set to override the host_index for a single
84
- request; this effectively ignores the host_index
85
- in the spec for a single request.
86
- :type _host_index: int, optional
87
- :return: Returns the result object.
88
- """ # noqa: E501
89
-
90
- _param = self._get_all_function_threat_scores_serialize(
91
- analysis_id=analysis_id,
92
- authorization=authorization,
93
- _request_auth=_request_auth,
94
- _content_type=_content_type,
95
- _headers=_headers,
96
- _host_index=_host_index
97
- )
98
-
99
- _response_types_map: Dict[str, Optional[str]] = {
100
- '200': "BaseResponseFunctionThreatScore",
101
- '422': "BaseResponse",
102
- }
103
- response_data = self.api_client.call_api(
104
- *_param,
105
- _request_timeout=_request_timeout
106
- )
107
- response_data.read()
108
- return self.api_client.response_deserialize(
109
- response_data=response_data,
110
- response_types_map=_response_types_map,
111
- ).data
112
-
113
-
114
- @validate_call
115
- def get_all_function_threat_scores_with_http_info(
116
- self,
117
- analysis_id: StrictInt,
118
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
119
- _request_timeout: Union[
120
- None,
121
- Annotated[StrictFloat, Field(gt=0)],
122
- Tuple[
123
- Annotated[StrictFloat, Field(gt=0)],
124
- Annotated[StrictFloat, Field(gt=0)]
125
- ]
126
- ] = None,
127
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
128
- _content_type: Optional[StrictStr] = None,
129
- _headers: Optional[Dict[StrictStr, Any]] = None,
130
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
131
- ) -> ApiResponse[BaseResponseFunctionThreatScore]:
132
- """Gets the threat score for all functions
133
-
134
- Calculates the threat score for all functions inside of an analysis
135
-
136
- :param analysis_id: (required)
137
- :type analysis_id: int
138
- :param authorization: API Key bearer token
139
- :type authorization: str
140
- :param _request_timeout: timeout setting for this request. If one
141
- number provided, it will be total request
142
- timeout. It can also be a pair (tuple) of
143
- (connection, read) timeouts.
144
- :type _request_timeout: int, tuple(int, int), optional
145
- :param _request_auth: set to override the auth_settings for an a single
146
- request; this effectively ignores the
147
- authentication in the spec for a single request.
148
- :type _request_auth: dict, optional
149
- :param _content_type: force content-type for the request.
150
- :type _content_type: str, Optional
151
- :param _headers: set to override the headers for a single
152
- request; this effectively ignores the headers
153
- in the spec for a single request.
154
- :type _headers: dict, optional
155
- :param _host_index: set to override the host_index for a single
156
- request; this effectively ignores the host_index
157
- in the spec for a single request.
158
- :type _host_index: int, optional
159
- :return: Returns the result object.
160
- """ # noqa: E501
161
-
162
- _param = self._get_all_function_threat_scores_serialize(
163
- analysis_id=analysis_id,
164
- authorization=authorization,
165
- _request_auth=_request_auth,
166
- _content_type=_content_type,
167
- _headers=_headers,
168
- _host_index=_host_index
169
- )
170
-
171
- _response_types_map: Dict[str, Optional[str]] = {
172
- '200': "BaseResponseFunctionThreatScore",
173
- '422': "BaseResponse",
174
- }
175
- response_data = self.api_client.call_api(
176
- *_param,
177
- _request_timeout=_request_timeout
178
- )
179
- response_data.read()
180
- return self.api_client.response_deserialize(
181
- response_data=response_data,
182
- response_types_map=_response_types_map,
183
- )
184
-
185
-
186
- @validate_call
187
- def get_all_function_threat_scores_without_preload_content(
188
- self,
189
- analysis_id: StrictInt,
190
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
191
- _request_timeout: Union[
192
- None,
193
- Annotated[StrictFloat, Field(gt=0)],
194
- Tuple[
195
- Annotated[StrictFloat, Field(gt=0)],
196
- Annotated[StrictFloat, Field(gt=0)]
197
- ]
198
- ] = None,
199
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
200
- _content_type: Optional[StrictStr] = None,
201
- _headers: Optional[Dict[StrictStr, Any]] = None,
202
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
203
- ) -> RESTResponseType:
204
- """Gets the threat score for all functions
205
-
206
- Calculates the threat score for all functions inside of an analysis
207
-
208
- :param analysis_id: (required)
209
- :type analysis_id: int
210
- :param authorization: API Key bearer token
211
- :type authorization: str
212
- :param _request_timeout: timeout setting for this request. If one
213
- number provided, it will be total request
214
- timeout. It can also be a pair (tuple) of
215
- (connection, read) timeouts.
216
- :type _request_timeout: int, tuple(int, int), optional
217
- :param _request_auth: set to override the auth_settings for an a single
218
- request; this effectively ignores the
219
- authentication in the spec for a single request.
220
- :type _request_auth: dict, optional
221
- :param _content_type: force content-type for the request.
222
- :type _content_type: str, Optional
223
- :param _headers: set to override the headers for a single
224
- request; this effectively ignores the headers
225
- in the spec for a single request.
226
- :type _headers: dict, optional
227
- :param _host_index: set to override the host_index for a single
228
- request; this effectively ignores the host_index
229
- in the spec for a single request.
230
- :type _host_index: int, optional
231
- :return: Returns the result object.
232
- """ # noqa: E501
233
-
234
- _param = self._get_all_function_threat_scores_serialize(
235
- analysis_id=analysis_id,
236
- authorization=authorization,
237
- _request_auth=_request_auth,
238
- _content_type=_content_type,
239
- _headers=_headers,
240
- _host_index=_host_index
241
- )
242
-
243
- _response_types_map: Dict[str, Optional[str]] = {
244
- '200': "BaseResponseFunctionThreatScore",
245
- '422': "BaseResponse",
246
- }
247
- response_data = self.api_client.call_api(
248
- *_param,
249
- _request_timeout=_request_timeout
250
- )
251
- return response_data.response
252
-
253
-
254
- def _get_all_function_threat_scores_serialize(
255
- self,
256
- analysis_id,
257
- authorization,
258
- _request_auth,
259
- _content_type,
260
- _headers,
261
- _host_index,
262
- ) -> RequestSerialized:
263
-
264
- _host = None
265
-
266
- _collection_formats: Dict[str, str] = {
267
- }
268
-
269
- _path_params: Dict[str, str] = {}
270
- _query_params: List[Tuple[str, str]] = []
271
- _header_params: Dict[str, Optional[str]] = _headers or {}
272
- _form_params: List[Tuple[str, str]] = []
273
- _files: Dict[
274
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
- ] = {}
276
- _body_params: Optional[bytes] = None
277
-
278
- # process the path parameters
279
- if analysis_id is not None:
280
- _path_params['analysis_id'] = analysis_id
281
- # process the query parameters
282
- # process the header parameters
283
- if authorization is not None:
284
- _header_params['authorization'] = authorization
285
- # process the form parameters
286
- # process the body parameter
287
-
288
-
289
- # set the HTTP header `Accept`
290
- if 'Accept' not in _header_params:
291
- _header_params['Accept'] = self.api_client.select_header_accept(
292
- [
293
- 'application/json'
294
- ]
295
- )
296
-
297
-
298
- # authentication setting
299
- _auth_settings: List[str] = [
300
- 'APIKey'
301
- ]
302
-
303
- return self.api_client.param_serialize(
304
- method='GET',
305
- resource_path='/v2/analyses/{analysis_id}/functions/threat_score',
306
- path_params=_path_params,
307
- query_params=_query_params,
308
- header_params=_header_params,
309
- body=_body_params,
310
- post_params=_form_params,
311
- files=_files,
312
- auth_settings=_auth_settings,
313
- collection_formats=_collection_formats,
314
- _host=_host,
315
- _request_auth=_request_auth
316
- )
317
-
318
-
319
-
320
-
321
- @validate_call
322
- def get_individual_function_threat_score(
323
- self,
324
- analysis_id: StrictInt,
325
- function_id: StrictInt,
326
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
327
- _request_timeout: Union[
328
- None,
329
- Annotated[StrictFloat, Field(gt=0)],
330
- Tuple[
331
- Annotated[StrictFloat, Field(gt=0)],
332
- Annotated[StrictFloat, Field(gt=0)]
333
- ]
334
- ] = None,
335
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
336
- _content_type: Optional[StrictStr] = None,
337
- _headers: Optional[Dict[StrictStr, Any]] = None,
338
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
339
- ) -> BaseResponseFunctionAnalysisThreatScoreData:
340
- """Gets the threat score analysis
341
-
342
-
343
- :param analysis_id: (required)
344
- :type analysis_id: int
345
- :param function_id: (required)
346
- :type function_id: int
347
- :param authorization: API Key bearer token
348
- :type authorization: str
349
- :param _request_timeout: timeout setting for this request. If one
350
- number provided, it will be total request
351
- timeout. It can also be a pair (tuple) of
352
- (connection, read) timeouts.
353
- :type _request_timeout: int, tuple(int, int), optional
354
- :param _request_auth: set to override the auth_settings for an a single
355
- request; this effectively ignores the
356
- authentication in the spec for a single request.
357
- :type _request_auth: dict, optional
358
- :param _content_type: force content-type for the request.
359
- :type _content_type: str, Optional
360
- :param _headers: set to override the headers for a single
361
- request; this effectively ignores the headers
362
- in the spec for a single request.
363
- :type _headers: dict, optional
364
- :param _host_index: set to override the host_index for a single
365
- request; this effectively ignores the host_index
366
- in the spec for a single request.
367
- :type _host_index: int, optional
368
- :return: Returns the result object.
369
- """ # noqa: E501
370
-
371
- _param = self._get_individual_function_threat_score_serialize(
372
- analysis_id=analysis_id,
373
- function_id=function_id,
374
- authorization=authorization,
375
- _request_auth=_request_auth,
376
- _content_type=_content_type,
377
- _headers=_headers,
378
- _host_index=_host_index
379
- )
380
-
381
- _response_types_map: Dict[str, Optional[str]] = {
382
- '200': "BaseResponseFunctionAnalysisThreatScoreData",
383
- '422': "BaseResponse",
384
- }
385
- response_data = self.api_client.call_api(
386
- *_param,
387
- _request_timeout=_request_timeout
388
- )
389
- response_data.read()
390
- return self.api_client.response_deserialize(
391
- response_data=response_data,
392
- response_types_map=_response_types_map,
393
- ).data
394
-
395
-
396
- @validate_call
397
- def get_individual_function_threat_score_with_http_info(
398
- self,
399
- analysis_id: StrictInt,
400
- function_id: StrictInt,
401
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
402
- _request_timeout: Union[
403
- None,
404
- Annotated[StrictFloat, Field(gt=0)],
405
- Tuple[
406
- Annotated[StrictFloat, Field(gt=0)],
407
- Annotated[StrictFloat, Field(gt=0)]
408
- ]
409
- ] = None,
410
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
411
- _content_type: Optional[StrictStr] = None,
412
- _headers: Optional[Dict[StrictStr, Any]] = None,
413
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
414
- ) -> ApiResponse[BaseResponseFunctionAnalysisThreatScoreData]:
415
- """Gets the threat score analysis
416
-
417
-
418
- :param analysis_id: (required)
419
- :type analysis_id: int
420
- :param function_id: (required)
421
- :type function_id: int
422
- :param authorization: API Key bearer token
423
- :type authorization: str
424
- :param _request_timeout: timeout setting for this request. If one
425
- number provided, it will be total request
426
- timeout. It can also be a pair (tuple) of
427
- (connection, read) timeouts.
428
- :type _request_timeout: int, tuple(int, int), optional
429
- :param _request_auth: set to override the auth_settings for an a single
430
- request; this effectively ignores the
431
- authentication in the spec for a single request.
432
- :type _request_auth: dict, optional
433
- :param _content_type: force content-type for the request.
434
- :type _content_type: str, Optional
435
- :param _headers: set to override the headers for a single
436
- request; this effectively ignores the headers
437
- in the spec for a single request.
438
- :type _headers: dict, optional
439
- :param _host_index: set to override the host_index for a single
440
- request; this effectively ignores the host_index
441
- in the spec for a single request.
442
- :type _host_index: int, optional
443
- :return: Returns the result object.
444
- """ # noqa: E501
445
-
446
- _param = self._get_individual_function_threat_score_serialize(
447
- analysis_id=analysis_id,
448
- function_id=function_id,
449
- authorization=authorization,
450
- _request_auth=_request_auth,
451
- _content_type=_content_type,
452
- _headers=_headers,
453
- _host_index=_host_index
454
- )
455
-
456
- _response_types_map: Dict[str, Optional[str]] = {
457
- '200': "BaseResponseFunctionAnalysisThreatScoreData",
458
- '422': "BaseResponse",
459
- }
460
- response_data = self.api_client.call_api(
461
- *_param,
462
- _request_timeout=_request_timeout
463
- )
464
- response_data.read()
465
- return self.api_client.response_deserialize(
466
- response_data=response_data,
467
- response_types_map=_response_types_map,
468
- )
469
-
470
-
471
- @validate_call
472
- def get_individual_function_threat_score_without_preload_content(
473
- self,
474
- analysis_id: StrictInt,
475
- function_id: StrictInt,
476
- authorization: Annotated[Optional[StrictStr], Field(description="API Key bearer token")] = None,
477
- _request_timeout: Union[
478
- None,
479
- Annotated[StrictFloat, Field(gt=0)],
480
- Tuple[
481
- Annotated[StrictFloat, Field(gt=0)],
482
- Annotated[StrictFloat, Field(gt=0)]
483
- ]
484
- ] = None,
485
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
486
- _content_type: Optional[StrictStr] = None,
487
- _headers: Optional[Dict[StrictStr, Any]] = None,
488
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
489
- ) -> RESTResponseType:
490
- """Gets the threat score analysis
491
-
492
-
493
- :param analysis_id: (required)
494
- :type analysis_id: int
495
- :param function_id: (required)
496
- :type function_id: int
497
- :param authorization: API Key bearer token
498
- :type authorization: str
499
- :param _request_timeout: timeout setting for this request. If one
500
- number provided, it will be total request
501
- timeout. It can also be a pair (tuple) of
502
- (connection, read) timeouts.
503
- :type _request_timeout: int, tuple(int, int), optional
504
- :param _request_auth: set to override the auth_settings for an a single
505
- request; this effectively ignores the
506
- authentication in the spec for a single request.
507
- :type _request_auth: dict, optional
508
- :param _content_type: force content-type for the request.
509
- :type _content_type: str, Optional
510
- :param _headers: set to override the headers for a single
511
- request; this effectively ignores the headers
512
- in the spec for a single request.
513
- :type _headers: dict, optional
514
- :param _host_index: set to override the host_index for a single
515
- request; this effectively ignores the host_index
516
- in the spec for a single request.
517
- :type _host_index: int, optional
518
- :return: Returns the result object.
519
- """ # noqa: E501
520
-
521
- _param = self._get_individual_function_threat_score_serialize(
522
- analysis_id=analysis_id,
523
- function_id=function_id,
524
- authorization=authorization,
525
- _request_auth=_request_auth,
526
- _content_type=_content_type,
527
- _headers=_headers,
528
- _host_index=_host_index
529
- )
530
-
531
- _response_types_map: Dict[str, Optional[str]] = {
532
- '200': "BaseResponseFunctionAnalysisThreatScoreData",
533
- '422': "BaseResponse",
534
- }
535
- response_data = self.api_client.call_api(
536
- *_param,
537
- _request_timeout=_request_timeout
538
- )
539
- return response_data.response
540
-
541
-
542
- def _get_individual_function_threat_score_serialize(
543
- self,
544
- analysis_id,
545
- function_id,
546
- authorization,
547
- _request_auth,
548
- _content_type,
549
- _headers,
550
- _host_index,
551
- ) -> RequestSerialized:
552
-
553
- _host = None
554
-
555
- _collection_formats: Dict[str, str] = {
556
- }
557
-
558
- _path_params: Dict[str, str] = {}
559
- _query_params: List[Tuple[str, str]] = []
560
- _header_params: Dict[str, Optional[str]] = _headers or {}
561
- _form_params: List[Tuple[str, str]] = []
562
- _files: Dict[
563
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
564
- ] = {}
565
- _body_params: Optional[bytes] = None
566
-
567
- # process the path parameters
568
- if analysis_id is not None:
569
- _path_params['analysis_id'] = analysis_id
570
- if function_id is not None:
571
- _path_params['function_id'] = function_id
572
- # process the query parameters
573
- # process the header parameters
574
- if authorization is not None:
575
- _header_params['authorization'] = authorization
576
- # process the form parameters
577
- # process the body parameter
578
-
579
-
580
- # set the HTTP header `Accept`
581
- if 'Accept' not in _header_params:
582
- _header_params['Accept'] = self.api_client.select_header_accept(
583
- [
584
- 'application/json'
585
- ]
586
- )
587
-
588
-
589
- # authentication setting
590
- _auth_settings: List[str] = [
591
- 'APIKey'
592
- ]
593
-
594
- return self.api_client.param_serialize(
595
- method='GET',
596
- resource_path='/v2/analyses/{analysis_id}/functions/{function_id}/threat_score',
597
- path_params=_path_params,
598
- query_params=_query_params,
599
- header_params=_header_params,
600
- body=_body_params,
601
- post_params=_form_params,
602
- files=_files,
603
- auth_settings=_auth_settings,
604
- collection_formats=_collection_formats,
605
- _host=_host,
606
- _request_auth=_request_auth
607
- )
608
-
609
-