revengai 2.3.0__py3-none-any.whl → 2.8.0__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.

Files changed (31) hide show
  1. revengai/__init__.py +1 -37
  2. revengai/api/__init__.py +0 -1
  3. revengai/api/analyses_core_api.py +0 -294
  4. revengai/api/functions_core_api.py +2 -369
  5. revengai/api_client.py +1 -1
  6. revengai/configuration.py +2 -2
  7. revengai/models/__init__.py +0 -17
  8. revengai/models/elf_relocation.py +1 -1
  9. revengai/models/functions_detail_response.py +4 -2
  10. {revengai-2.3.0.dist-info → revengai-2.8.0.dist-info}/METADATA +1 -24
  11. {revengai-2.3.0.dist-info → revengai-2.8.0.dist-info}/RECORD +13 -31
  12. revengai/api/confidence_api.py +0 -1152
  13. revengai/models/ann_function.py +0 -122
  14. revengai/models/base_response_box_plot_confidence.py +0 -125
  15. revengai/models/base_response_list_function_box_plot_confidence.py +0 -129
  16. revengai/models/base_response_list_similar_functions_response.py +0 -129
  17. revengai/models/base_response_list_tag_origin_box_plot_confidence.py +0 -129
  18. revengai/models/base_response_nearest_neighbor_analysis.py +0 -135
  19. revengai/models/box_plot_confidence.py +0 -98
  20. revengai/models/function_box_plot_confidence.py +0 -92
  21. revengai/models/function_name_confidence_body.py +0 -97
  22. revengai/models/function_name_input.py +0 -88
  23. revengai/models/nearest_neighbor.py +0 -105
  24. revengai/models/origin.py +0 -42
  25. revengai/models/similar_functions_response.py +0 -100
  26. revengai/models/tag_confidence_body.py +0 -95
  27. revengai/models/tag_origin_box_plot_confidence.py +0 -96
  28. revengai/models/tags.py +0 -89
  29. revengai/models/threat_score_function_body.py +0 -87
  30. {revengai-2.3.0.dist-info → revengai-2.8.0.dist-info}/WHEEL +0 -0
  31. {revengai-2.3.0.dist-info → revengai-2.8.0.dist-info}/licenses/LICENSE.md +0 -0
@@ -1,1152 +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
19
- from typing_extensions import Annotated
20
- from revengai.models.base_response_box_plot_confidence import BaseResponseBoxPlotConfidence
21
- from revengai.models.base_response_list_function_box_plot_confidence import BaseResponseListFunctionBoxPlotConfidence
22
- from revengai.models.base_response_list_tag_origin_box_plot_confidence import BaseResponseListTagOriginBoxPlotConfidence
23
- from revengai.models.function_name_confidence_body import FunctionNameConfidenceBody
24
- from revengai.models.tag_confidence_body import TagConfidenceBody
25
- from revengai.models.threat_score_function_body import ThreatScoreFunctionBody
26
-
27
- from revengai.api_client import ApiClient, RequestSerialized
28
- from revengai.api_response import ApiResponse
29
- from revengai.rest import RESTResponseType
30
-
31
-
32
- class ConfidenceApi:
33
- """NOTE: This class is auto generated by OpenAPI Generator
34
- Ref: https://openapi-generator.tech
35
-
36
- Do not edit the class manually.
37
- """
38
-
39
- def __init__(self, api_client=None) -> None:
40
- if api_client is None:
41
- api_client = ApiClient.get_default()
42
- self.api_client = api_client
43
-
44
-
45
- @validate_call
46
- def get_analysis_tag_score(
47
- self,
48
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the tag scores for")],
49
- tag_confidence_body: TagConfidenceBody,
50
- _request_timeout: Union[
51
- None,
52
- Annotated[StrictFloat, Field(gt=0)],
53
- Tuple[
54
- Annotated[StrictFloat, Field(gt=0)],
55
- Annotated[StrictFloat, Field(gt=0)]
56
- ]
57
- ] = None,
58
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
59
- _content_type: Optional[StrictStr] = None,
60
- _headers: Optional[Dict[StrictStr, Any]] = None,
61
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
62
- ) -> BaseResponseListTagOriginBoxPlotConfidence:
63
- """Calculate Tag Confidence Score for an Analysis
64
-
65
- Accepts a analysis ID and a list of tags, returns the confidence score for each tag in the list
66
-
67
- :param analysis_id: The analysis to calculate the tag scores for (required)
68
- :type analysis_id: int
69
- :param tag_confidence_body: (required)
70
- :type tag_confidence_body: TagConfidenceBody
71
- :param _request_timeout: timeout setting for this request. If one
72
- number provided, it will be total request
73
- timeout. It can also be a pair (tuple) of
74
- (connection, read) timeouts.
75
- :type _request_timeout: int, tuple(int, int), optional
76
- :param _request_auth: set to override the auth_settings for an a single
77
- request; this effectively ignores the
78
- authentication in the spec for a single request.
79
- :type _request_auth: dict, optional
80
- :param _content_type: force content-type for the request.
81
- :type _content_type: str, Optional
82
- :param _headers: set to override the headers for a single
83
- request; this effectively ignores the headers
84
- in the spec for a single request.
85
- :type _headers: dict, optional
86
- :param _host_index: set to override the host_index for a single
87
- request; this effectively ignores the host_index
88
- in the spec for a single request.
89
- :type _host_index: int, optional
90
- :return: Returns the result object.
91
- """ # noqa: E501
92
-
93
- _param = self._get_analysis_tag_score_serialize(
94
- analysis_id=analysis_id,
95
- tag_confidence_body=tag_confidence_body,
96
- _request_auth=_request_auth,
97
- _content_type=_content_type,
98
- _headers=_headers,
99
- _host_index=_host_index
100
- )
101
-
102
- _response_types_map: Dict[str, Optional[str]] = {
103
- '200': "BaseResponseListTagOriginBoxPlotConfidence",
104
- '422': "BaseResponse",
105
- }
106
- response_data = self.api_client.call_api(
107
- *_param,
108
- _request_timeout=_request_timeout
109
- )
110
- response_data.read()
111
- return self.api_client.response_deserialize(
112
- response_data=response_data,
113
- response_types_map=_response_types_map,
114
- ).data
115
-
116
-
117
- @validate_call
118
- def get_analysis_tag_score_with_http_info(
119
- self,
120
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the tag scores for")],
121
- tag_confidence_body: TagConfidenceBody,
122
- _request_timeout: Union[
123
- None,
124
- Annotated[StrictFloat, Field(gt=0)],
125
- Tuple[
126
- Annotated[StrictFloat, Field(gt=0)],
127
- Annotated[StrictFloat, Field(gt=0)]
128
- ]
129
- ] = None,
130
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
- _content_type: Optional[StrictStr] = None,
132
- _headers: Optional[Dict[StrictStr, Any]] = None,
133
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
- ) -> ApiResponse[BaseResponseListTagOriginBoxPlotConfidence]:
135
- """Calculate Tag Confidence Score for an Analysis
136
-
137
- Accepts a analysis ID and a list of tags, returns the confidence score for each tag in the list
138
-
139
- :param analysis_id: The analysis to calculate the tag scores for (required)
140
- :type analysis_id: int
141
- :param tag_confidence_body: (required)
142
- :type tag_confidence_body: TagConfidenceBody
143
- :param _request_timeout: timeout setting for this request. If one
144
- number provided, it will be total request
145
- timeout. It can also be a pair (tuple) of
146
- (connection, read) timeouts.
147
- :type _request_timeout: int, tuple(int, int), optional
148
- :param _request_auth: set to override the auth_settings for an a single
149
- request; this effectively ignores the
150
- authentication in the spec for a single request.
151
- :type _request_auth: dict, optional
152
- :param _content_type: force content-type for the request.
153
- :type _content_type: str, Optional
154
- :param _headers: set to override the headers for a single
155
- request; this effectively ignores the headers
156
- in the spec for a single request.
157
- :type _headers: dict, optional
158
- :param _host_index: set to override the host_index for a single
159
- request; this effectively ignores the host_index
160
- in the spec for a single request.
161
- :type _host_index: int, optional
162
- :return: Returns the result object.
163
- """ # noqa: E501
164
-
165
- _param = self._get_analysis_tag_score_serialize(
166
- analysis_id=analysis_id,
167
- tag_confidence_body=tag_confidence_body,
168
- _request_auth=_request_auth,
169
- _content_type=_content_type,
170
- _headers=_headers,
171
- _host_index=_host_index
172
- )
173
-
174
- _response_types_map: Dict[str, Optional[str]] = {
175
- '200': "BaseResponseListTagOriginBoxPlotConfidence",
176
- '422': "BaseResponse",
177
- }
178
- response_data = self.api_client.call_api(
179
- *_param,
180
- _request_timeout=_request_timeout
181
- )
182
- response_data.read()
183
- return self.api_client.response_deserialize(
184
- response_data=response_data,
185
- response_types_map=_response_types_map,
186
- )
187
-
188
-
189
- @validate_call
190
- def get_analysis_tag_score_without_preload_content(
191
- self,
192
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the tag scores for")],
193
- tag_confidence_body: TagConfidenceBody,
194
- _request_timeout: Union[
195
- None,
196
- Annotated[StrictFloat, Field(gt=0)],
197
- Tuple[
198
- Annotated[StrictFloat, Field(gt=0)],
199
- Annotated[StrictFloat, Field(gt=0)]
200
- ]
201
- ] = None,
202
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
203
- _content_type: Optional[StrictStr] = None,
204
- _headers: Optional[Dict[StrictStr, Any]] = None,
205
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
206
- ) -> RESTResponseType:
207
- """Calculate Tag Confidence Score for an Analysis
208
-
209
- Accepts a analysis ID and a list of tags, returns the confidence score for each tag in the list
210
-
211
- :param analysis_id: The analysis to calculate the tag scores for (required)
212
- :type analysis_id: int
213
- :param tag_confidence_body: (required)
214
- :type tag_confidence_body: TagConfidenceBody
215
- :param _request_timeout: timeout setting for this request. If one
216
- number provided, it will be total request
217
- timeout. It can also be a pair (tuple) of
218
- (connection, read) timeouts.
219
- :type _request_timeout: int, tuple(int, int), optional
220
- :param _request_auth: set to override the auth_settings for an a single
221
- request; this effectively ignores the
222
- authentication in the spec for a single request.
223
- :type _request_auth: dict, optional
224
- :param _content_type: force content-type for the request.
225
- :type _content_type: str, Optional
226
- :param _headers: set to override the headers for a single
227
- request; this effectively ignores the headers
228
- in the spec for a single request.
229
- :type _headers: dict, optional
230
- :param _host_index: set to override the host_index for a single
231
- request; this effectively ignores the host_index
232
- in the spec for a single request.
233
- :type _host_index: int, optional
234
- :return: Returns the result object.
235
- """ # noqa: E501
236
-
237
- _param = self._get_analysis_tag_score_serialize(
238
- analysis_id=analysis_id,
239
- tag_confidence_body=tag_confidence_body,
240
- _request_auth=_request_auth,
241
- _content_type=_content_type,
242
- _headers=_headers,
243
- _host_index=_host_index
244
- )
245
-
246
- _response_types_map: Dict[str, Optional[str]] = {
247
- '200': "BaseResponseListTagOriginBoxPlotConfidence",
248
- '422': "BaseResponse",
249
- }
250
- response_data = self.api_client.call_api(
251
- *_param,
252
- _request_timeout=_request_timeout
253
- )
254
- return response_data.response
255
-
256
-
257
- def _get_analysis_tag_score_serialize(
258
- self,
259
- analysis_id,
260
- tag_confidence_body,
261
- _request_auth,
262
- _content_type,
263
- _headers,
264
- _host_index,
265
- ) -> RequestSerialized:
266
-
267
- _host = None
268
-
269
- _collection_formats: Dict[str, str] = {
270
- }
271
-
272
- _path_params: Dict[str, str] = {}
273
- _query_params: List[Tuple[str, str]] = []
274
- _header_params: Dict[str, Optional[str]] = _headers or {}
275
- _form_params: List[Tuple[str, str]] = []
276
- _files: Dict[
277
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
278
- ] = {}
279
- _body_params: Optional[bytes] = None
280
-
281
- # process the path parameters
282
- if analysis_id is not None:
283
- _path_params['analysis_id'] = analysis_id
284
- # process the query parameters
285
- # process the header parameters
286
- # process the form parameters
287
- # process the body parameter
288
- if tag_confidence_body is not None:
289
- _body_params = tag_confidence_body
290
-
291
-
292
- # set the HTTP header `Accept`
293
- if 'Accept' not in _header_params:
294
- _header_params['Accept'] = self.api_client.select_header_accept(
295
- [
296
- 'application/json'
297
- ]
298
- )
299
-
300
- # set the HTTP header `Content-Type`
301
- if _content_type:
302
- _header_params['Content-Type'] = _content_type
303
- else:
304
- _default_content_type = (
305
- self.api_client.select_header_content_type(
306
- [
307
- 'application/json'
308
- ]
309
- )
310
- )
311
- if _default_content_type is not None:
312
- _header_params['Content-Type'] = _default_content_type
313
-
314
- # authentication setting
315
- _auth_settings: List[str] = [
316
- 'APIKey'
317
- ]
318
-
319
- return self.api_client.param_serialize(
320
- method='POST',
321
- resource_path='/v2/confidence/analysis/{analysis_id}/tag_score',
322
- path_params=_path_params,
323
- query_params=_query_params,
324
- header_params=_header_params,
325
- body=_body_params,
326
- post_params=_form_params,
327
- files=_files,
328
- auth_settings=_auth_settings,
329
- collection_formats=_collection_formats,
330
- _host=_host,
331
- _request_auth=_request_auth
332
- )
333
-
334
-
335
-
336
-
337
- @validate_call
338
- def get_analysis_threat_score(
339
- self,
340
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the threat score for")],
341
- _request_timeout: Union[
342
- None,
343
- Annotated[StrictFloat, Field(gt=0)],
344
- Tuple[
345
- Annotated[StrictFloat, Field(gt=0)],
346
- Annotated[StrictFloat, Field(gt=0)]
347
- ]
348
- ] = None,
349
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
350
- _content_type: Optional[StrictStr] = None,
351
- _headers: Optional[Dict[StrictStr, Any]] = None,
352
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
353
- ) -> BaseResponseBoxPlotConfidence:
354
- """Calculate Threat Score for Binary
355
-
356
- Accepts a binary ID and returns the threat score for that binary
357
-
358
- :param analysis_id: The analysis to calculate the threat score for (required)
359
- :type analysis_id: int
360
- :param _request_timeout: timeout setting for this request. If one
361
- number provided, it will be total request
362
- timeout. It can also be a pair (tuple) of
363
- (connection, read) timeouts.
364
- :type _request_timeout: int, tuple(int, int), optional
365
- :param _request_auth: set to override the auth_settings for an a single
366
- request; this effectively ignores the
367
- authentication in the spec for a single request.
368
- :type _request_auth: dict, optional
369
- :param _content_type: force content-type for the request.
370
- :type _content_type: str, Optional
371
- :param _headers: set to override the headers for a single
372
- request; this effectively ignores the headers
373
- in the spec for a single request.
374
- :type _headers: dict, optional
375
- :param _host_index: set to override the host_index for a single
376
- request; this effectively ignores the host_index
377
- in the spec for a single request.
378
- :type _host_index: int, optional
379
- :return: Returns the result object.
380
- """ # noqa: E501
381
-
382
- _param = self._get_analysis_threat_score_serialize(
383
- analysis_id=analysis_id,
384
- _request_auth=_request_auth,
385
- _content_type=_content_type,
386
- _headers=_headers,
387
- _host_index=_host_index
388
- )
389
-
390
- _response_types_map: Dict[str, Optional[str]] = {
391
- '200': "BaseResponseBoxPlotConfidence",
392
- '422': "BaseResponse",
393
- }
394
- response_data = self.api_client.call_api(
395
- *_param,
396
- _request_timeout=_request_timeout
397
- )
398
- response_data.read()
399
- return self.api_client.response_deserialize(
400
- response_data=response_data,
401
- response_types_map=_response_types_map,
402
- ).data
403
-
404
-
405
- @validate_call
406
- def get_analysis_threat_score_with_http_info(
407
- self,
408
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the threat score for")],
409
- _request_timeout: Union[
410
- None,
411
- Annotated[StrictFloat, Field(gt=0)],
412
- Tuple[
413
- Annotated[StrictFloat, Field(gt=0)],
414
- Annotated[StrictFloat, Field(gt=0)]
415
- ]
416
- ] = None,
417
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
418
- _content_type: Optional[StrictStr] = None,
419
- _headers: Optional[Dict[StrictStr, Any]] = None,
420
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
421
- ) -> ApiResponse[BaseResponseBoxPlotConfidence]:
422
- """Calculate Threat Score for Binary
423
-
424
- Accepts a binary ID and returns the threat score for that binary
425
-
426
- :param analysis_id: The analysis to calculate the threat score for (required)
427
- :type analysis_id: int
428
- :param _request_timeout: timeout setting for this request. If one
429
- number provided, it will be total request
430
- timeout. It can also be a pair (tuple) of
431
- (connection, read) timeouts.
432
- :type _request_timeout: int, tuple(int, int), optional
433
- :param _request_auth: set to override the auth_settings for an a single
434
- request; this effectively ignores the
435
- authentication in the spec for a single request.
436
- :type _request_auth: dict, optional
437
- :param _content_type: force content-type for the request.
438
- :type _content_type: str, Optional
439
- :param _headers: set to override the headers for a single
440
- request; this effectively ignores the headers
441
- in the spec for a single request.
442
- :type _headers: dict, optional
443
- :param _host_index: set to override the host_index for a single
444
- request; this effectively ignores the host_index
445
- in the spec for a single request.
446
- :type _host_index: int, optional
447
- :return: Returns the result object.
448
- """ # noqa: E501
449
-
450
- _param = self._get_analysis_threat_score_serialize(
451
- analysis_id=analysis_id,
452
- _request_auth=_request_auth,
453
- _content_type=_content_type,
454
- _headers=_headers,
455
- _host_index=_host_index
456
- )
457
-
458
- _response_types_map: Dict[str, Optional[str]] = {
459
- '200': "BaseResponseBoxPlotConfidence",
460
- '422': "BaseResponse",
461
- }
462
- response_data = self.api_client.call_api(
463
- *_param,
464
- _request_timeout=_request_timeout
465
- )
466
- response_data.read()
467
- return self.api_client.response_deserialize(
468
- response_data=response_data,
469
- response_types_map=_response_types_map,
470
- )
471
-
472
-
473
- @validate_call
474
- def get_analysis_threat_score_without_preload_content(
475
- self,
476
- analysis_id: Annotated[StrictInt, Field(description="The analysis to calculate the threat score for")],
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
- """Calculate Threat Score for Binary
491
-
492
- Accepts a binary ID and returns the threat score for that binary
493
-
494
- :param analysis_id: The analysis to calculate the threat score for (required)
495
- :type analysis_id: int
496
- :param _request_timeout: timeout setting for this request. If one
497
- number provided, it will be total request
498
- timeout. It can also be a pair (tuple) of
499
- (connection, read) timeouts.
500
- :type _request_timeout: int, tuple(int, int), optional
501
- :param _request_auth: set to override the auth_settings for an a single
502
- request; this effectively ignores the
503
- authentication in the spec for a single request.
504
- :type _request_auth: dict, optional
505
- :param _content_type: force content-type for the request.
506
- :type _content_type: str, Optional
507
- :param _headers: set to override the headers for a single
508
- request; this effectively ignores the headers
509
- in the spec for a single request.
510
- :type _headers: dict, optional
511
- :param _host_index: set to override the host_index for a single
512
- request; this effectively ignores the host_index
513
- in the spec for a single request.
514
- :type _host_index: int, optional
515
- :return: Returns the result object.
516
- """ # noqa: E501
517
-
518
- _param = self._get_analysis_threat_score_serialize(
519
- analysis_id=analysis_id,
520
- _request_auth=_request_auth,
521
- _content_type=_content_type,
522
- _headers=_headers,
523
- _host_index=_host_index
524
- )
525
-
526
- _response_types_map: Dict[str, Optional[str]] = {
527
- '200': "BaseResponseBoxPlotConfidence",
528
- '422': "BaseResponse",
529
- }
530
- response_data = self.api_client.call_api(
531
- *_param,
532
- _request_timeout=_request_timeout
533
- )
534
- return response_data.response
535
-
536
-
537
- def _get_analysis_threat_score_serialize(
538
- self,
539
- analysis_id,
540
- _request_auth,
541
- _content_type,
542
- _headers,
543
- _host_index,
544
- ) -> RequestSerialized:
545
-
546
- _host = None
547
-
548
- _collection_formats: Dict[str, str] = {
549
- }
550
-
551
- _path_params: Dict[str, str] = {}
552
- _query_params: List[Tuple[str, str]] = []
553
- _header_params: Dict[str, Optional[str]] = _headers or {}
554
- _form_params: List[Tuple[str, str]] = []
555
- _files: Dict[
556
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
557
- ] = {}
558
- _body_params: Optional[bytes] = None
559
-
560
- # process the path parameters
561
- if analysis_id is not None:
562
- _path_params['analysis_id'] = analysis_id
563
- # process the query parameters
564
- # process the header parameters
565
- # process the form parameters
566
- # process the body parameter
567
-
568
-
569
- # set the HTTP header `Accept`
570
- if 'Accept' not in _header_params:
571
- _header_params['Accept'] = self.api_client.select_header_accept(
572
- [
573
- 'application/json'
574
- ]
575
- )
576
-
577
-
578
- # authentication setting
579
- _auth_settings: List[str] = [
580
- 'APIKey'
581
- ]
582
-
583
- return self.api_client.param_serialize(
584
- method='GET',
585
- resource_path='/v2/confidence/analysis/{analysis_id}/threat_score',
586
- path_params=_path_params,
587
- query_params=_query_params,
588
- header_params=_header_params,
589
- body=_body_params,
590
- post_params=_form_params,
591
- files=_files,
592
- auth_settings=_auth_settings,
593
- collection_formats=_collection_formats,
594
- _host=_host,
595
- _request_auth=_request_auth
596
- )
597
-
598
-
599
-
600
-
601
- @validate_call
602
- def get_functions_name_score(
603
- self,
604
- function_name_confidence_body: FunctionNameConfidenceBody,
605
- _request_timeout: Union[
606
- None,
607
- Annotated[StrictFloat, Field(gt=0)],
608
- Tuple[
609
- Annotated[StrictFloat, Field(gt=0)],
610
- Annotated[StrictFloat, Field(gt=0)]
611
- ]
612
- ] = None,
613
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
614
- _content_type: Optional[StrictStr] = None,
615
- _headers: Optional[Dict[StrictStr, Any]] = None,
616
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
617
- ) -> BaseResponseListFunctionBoxPlotConfidence:
618
- """Calculate function name confidence for a set of Functions
619
-
620
- Accepts a list of function ids mapped to a function name, for each function we return a confidence score in that being the correct name for each function. Each function must be from the same model, or you may find some functions missing in the return.
621
-
622
- :param function_name_confidence_body: (required)
623
- :type function_name_confidence_body: FunctionNameConfidenceBody
624
- :param _request_timeout: timeout setting for this request. If one
625
- number provided, it will be total request
626
- timeout. It can also be a pair (tuple) of
627
- (connection, read) timeouts.
628
- :type _request_timeout: int, tuple(int, int), optional
629
- :param _request_auth: set to override the auth_settings for an a single
630
- request; this effectively ignores the
631
- authentication in the spec for a single request.
632
- :type _request_auth: dict, optional
633
- :param _content_type: force content-type for the request.
634
- :type _content_type: str, Optional
635
- :param _headers: set to override the headers for a single
636
- request; this effectively ignores the headers
637
- in the spec for a single request.
638
- :type _headers: dict, optional
639
- :param _host_index: set to override the host_index for a single
640
- request; this effectively ignores the host_index
641
- in the spec for a single request.
642
- :type _host_index: int, optional
643
- :return: Returns the result object.
644
- """ # noqa: E501
645
-
646
- _param = self._get_functions_name_score_serialize(
647
- function_name_confidence_body=function_name_confidence_body,
648
- _request_auth=_request_auth,
649
- _content_type=_content_type,
650
- _headers=_headers,
651
- _host_index=_host_index
652
- )
653
-
654
- _response_types_map: Dict[str, Optional[str]] = {
655
- '200': "BaseResponseListFunctionBoxPlotConfidence",
656
- '422': "BaseResponse",
657
- }
658
- response_data = self.api_client.call_api(
659
- *_param,
660
- _request_timeout=_request_timeout
661
- )
662
- response_data.read()
663
- return self.api_client.response_deserialize(
664
- response_data=response_data,
665
- response_types_map=_response_types_map,
666
- ).data
667
-
668
-
669
- @validate_call
670
- def get_functions_name_score_with_http_info(
671
- self,
672
- function_name_confidence_body: FunctionNameConfidenceBody,
673
- _request_timeout: Union[
674
- None,
675
- Annotated[StrictFloat, Field(gt=0)],
676
- Tuple[
677
- Annotated[StrictFloat, Field(gt=0)],
678
- Annotated[StrictFloat, Field(gt=0)]
679
- ]
680
- ] = None,
681
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
682
- _content_type: Optional[StrictStr] = None,
683
- _headers: Optional[Dict[StrictStr, Any]] = None,
684
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
685
- ) -> ApiResponse[BaseResponseListFunctionBoxPlotConfidence]:
686
- """Calculate function name confidence for a set of Functions
687
-
688
- Accepts a list of function ids mapped to a function name, for each function we return a confidence score in that being the correct name for each function. Each function must be from the same model, or you may find some functions missing in the return.
689
-
690
- :param function_name_confidence_body: (required)
691
- :type function_name_confidence_body: FunctionNameConfidenceBody
692
- :param _request_timeout: timeout setting for this request. If one
693
- number provided, it will be total request
694
- timeout. It can also be a pair (tuple) of
695
- (connection, read) timeouts.
696
- :type _request_timeout: int, tuple(int, int), optional
697
- :param _request_auth: set to override the auth_settings for an a single
698
- request; this effectively ignores the
699
- authentication in the spec for a single request.
700
- :type _request_auth: dict, optional
701
- :param _content_type: force content-type for the request.
702
- :type _content_type: str, Optional
703
- :param _headers: set to override the headers for a single
704
- request; this effectively ignores the headers
705
- in the spec for a single request.
706
- :type _headers: dict, optional
707
- :param _host_index: set to override the host_index for a single
708
- request; this effectively ignores the host_index
709
- in the spec for a single request.
710
- :type _host_index: int, optional
711
- :return: Returns the result object.
712
- """ # noqa: E501
713
-
714
- _param = self._get_functions_name_score_serialize(
715
- function_name_confidence_body=function_name_confidence_body,
716
- _request_auth=_request_auth,
717
- _content_type=_content_type,
718
- _headers=_headers,
719
- _host_index=_host_index
720
- )
721
-
722
- _response_types_map: Dict[str, Optional[str]] = {
723
- '200': "BaseResponseListFunctionBoxPlotConfidence",
724
- '422': "BaseResponse",
725
- }
726
- response_data = self.api_client.call_api(
727
- *_param,
728
- _request_timeout=_request_timeout
729
- )
730
- response_data.read()
731
- return self.api_client.response_deserialize(
732
- response_data=response_data,
733
- response_types_map=_response_types_map,
734
- )
735
-
736
-
737
- @validate_call
738
- def get_functions_name_score_without_preload_content(
739
- self,
740
- function_name_confidence_body: FunctionNameConfidenceBody,
741
- _request_timeout: Union[
742
- None,
743
- Annotated[StrictFloat, Field(gt=0)],
744
- Tuple[
745
- Annotated[StrictFloat, Field(gt=0)],
746
- Annotated[StrictFloat, Field(gt=0)]
747
- ]
748
- ] = None,
749
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
750
- _content_type: Optional[StrictStr] = None,
751
- _headers: Optional[Dict[StrictStr, Any]] = None,
752
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
753
- ) -> RESTResponseType:
754
- """Calculate function name confidence for a set of Functions
755
-
756
- Accepts a list of function ids mapped to a function name, for each function we return a confidence score in that being the correct name for each function. Each function must be from the same model, or you may find some functions missing in the return.
757
-
758
- :param function_name_confidence_body: (required)
759
- :type function_name_confidence_body: FunctionNameConfidenceBody
760
- :param _request_timeout: timeout setting for this request. If one
761
- number provided, it will be total request
762
- timeout. It can also be a pair (tuple) of
763
- (connection, read) timeouts.
764
- :type _request_timeout: int, tuple(int, int), optional
765
- :param _request_auth: set to override the auth_settings for an a single
766
- request; this effectively ignores the
767
- authentication in the spec for a single request.
768
- :type _request_auth: dict, optional
769
- :param _content_type: force content-type for the request.
770
- :type _content_type: str, Optional
771
- :param _headers: set to override the headers for a single
772
- request; this effectively ignores the headers
773
- in the spec for a single request.
774
- :type _headers: dict, optional
775
- :param _host_index: set to override the host_index for a single
776
- request; this effectively ignores the host_index
777
- in the spec for a single request.
778
- :type _host_index: int, optional
779
- :return: Returns the result object.
780
- """ # noqa: E501
781
-
782
- _param = self._get_functions_name_score_serialize(
783
- function_name_confidence_body=function_name_confidence_body,
784
- _request_auth=_request_auth,
785
- _content_type=_content_type,
786
- _headers=_headers,
787
- _host_index=_host_index
788
- )
789
-
790
- _response_types_map: Dict[str, Optional[str]] = {
791
- '200': "BaseResponseListFunctionBoxPlotConfidence",
792
- '422': "BaseResponse",
793
- }
794
- response_data = self.api_client.call_api(
795
- *_param,
796
- _request_timeout=_request_timeout
797
- )
798
- return response_data.response
799
-
800
-
801
- def _get_functions_name_score_serialize(
802
- self,
803
- function_name_confidence_body,
804
- _request_auth,
805
- _content_type,
806
- _headers,
807
- _host_index,
808
- ) -> RequestSerialized:
809
-
810
- _host = None
811
-
812
- _collection_formats: Dict[str, str] = {
813
- }
814
-
815
- _path_params: Dict[str, str] = {}
816
- _query_params: List[Tuple[str, str]] = []
817
- _header_params: Dict[str, Optional[str]] = _headers or {}
818
- _form_params: List[Tuple[str, str]] = []
819
- _files: Dict[
820
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
821
- ] = {}
822
- _body_params: Optional[bytes] = None
823
-
824
- # process the path parameters
825
- # process the query parameters
826
- # process the header parameters
827
- # process the form parameters
828
- # process the body parameter
829
- if function_name_confidence_body is not None:
830
- _body_params = function_name_confidence_body
831
-
832
-
833
- # set the HTTP header `Accept`
834
- if 'Accept' not in _header_params:
835
- _header_params['Accept'] = self.api_client.select_header_accept(
836
- [
837
- 'application/json'
838
- ]
839
- )
840
-
841
- # set the HTTP header `Content-Type`
842
- if _content_type:
843
- _header_params['Content-Type'] = _content_type
844
- else:
845
- _default_content_type = (
846
- self.api_client.select_header_content_type(
847
- [
848
- 'application/json'
849
- ]
850
- )
851
- )
852
- if _default_content_type is not None:
853
- _header_params['Content-Type'] = _default_content_type
854
-
855
- # authentication setting
856
- _auth_settings: List[str] = [
857
- 'APIKey'
858
- ]
859
-
860
- return self.api_client.param_serialize(
861
- method='POST',
862
- resource_path='/v2/confidence/functions/name_score',
863
- path_params=_path_params,
864
- query_params=_query_params,
865
- header_params=_header_params,
866
- body=_body_params,
867
- post_params=_form_params,
868
- files=_files,
869
- auth_settings=_auth_settings,
870
- collection_formats=_collection_formats,
871
- _host=_host,
872
- _request_auth=_request_auth
873
- )
874
-
875
-
876
-
877
-
878
- @validate_call
879
- def get_functions_threat_score(
880
- self,
881
- threat_score_function_body: ThreatScoreFunctionBody,
882
- _request_timeout: Union[
883
- None,
884
- Annotated[StrictFloat, Field(gt=0)],
885
- Tuple[
886
- Annotated[StrictFloat, Field(gt=0)],
887
- Annotated[StrictFloat, Field(gt=0)]
888
- ]
889
- ] = None,
890
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
891
- _content_type: Optional[StrictStr] = None,
892
- _headers: Optional[Dict[StrictStr, Any]] = None,
893
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
894
- ) -> BaseResponseListFunctionBoxPlotConfidence:
895
- """Calculate Threat Score for a set of Functions
896
-
897
- Accepts a list of function ids and returns the threat score for each function. Each function must be from the same model, or you may find some functions missing in the return.
898
-
899
- :param threat_score_function_body: (required)
900
- :type threat_score_function_body: ThreatScoreFunctionBody
901
- :param _request_timeout: timeout setting for this request. If one
902
- number provided, it will be total request
903
- timeout. It can also be a pair (tuple) of
904
- (connection, read) timeouts.
905
- :type _request_timeout: int, tuple(int, int), optional
906
- :param _request_auth: set to override the auth_settings for an a single
907
- request; this effectively ignores the
908
- authentication in the spec for a single request.
909
- :type _request_auth: dict, optional
910
- :param _content_type: force content-type for the request.
911
- :type _content_type: str, Optional
912
- :param _headers: set to override the headers for a single
913
- request; this effectively ignores the headers
914
- in the spec for a single request.
915
- :type _headers: dict, optional
916
- :param _host_index: set to override the host_index for a single
917
- request; this effectively ignores the host_index
918
- in the spec for a single request.
919
- :type _host_index: int, optional
920
- :return: Returns the result object.
921
- """ # noqa: E501
922
-
923
- _param = self._get_functions_threat_score_serialize(
924
- threat_score_function_body=threat_score_function_body,
925
- _request_auth=_request_auth,
926
- _content_type=_content_type,
927
- _headers=_headers,
928
- _host_index=_host_index
929
- )
930
-
931
- _response_types_map: Dict[str, Optional[str]] = {
932
- '200': "BaseResponseListFunctionBoxPlotConfidence",
933
- '422': "BaseResponse",
934
- }
935
- response_data = self.api_client.call_api(
936
- *_param,
937
- _request_timeout=_request_timeout
938
- )
939
- response_data.read()
940
- return self.api_client.response_deserialize(
941
- response_data=response_data,
942
- response_types_map=_response_types_map,
943
- ).data
944
-
945
-
946
- @validate_call
947
- def get_functions_threat_score_with_http_info(
948
- self,
949
- threat_score_function_body: ThreatScoreFunctionBody,
950
- _request_timeout: Union[
951
- None,
952
- Annotated[StrictFloat, Field(gt=0)],
953
- Tuple[
954
- Annotated[StrictFloat, Field(gt=0)],
955
- Annotated[StrictFloat, Field(gt=0)]
956
- ]
957
- ] = None,
958
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
959
- _content_type: Optional[StrictStr] = None,
960
- _headers: Optional[Dict[StrictStr, Any]] = None,
961
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
962
- ) -> ApiResponse[BaseResponseListFunctionBoxPlotConfidence]:
963
- """Calculate Threat Score for a set of Functions
964
-
965
- Accepts a list of function ids and returns the threat score for each function. Each function must be from the same model, or you may find some functions missing in the return.
966
-
967
- :param threat_score_function_body: (required)
968
- :type threat_score_function_body: ThreatScoreFunctionBody
969
- :param _request_timeout: timeout setting for this request. If one
970
- number provided, it will be total request
971
- timeout. It can also be a pair (tuple) of
972
- (connection, read) timeouts.
973
- :type _request_timeout: int, tuple(int, int), optional
974
- :param _request_auth: set to override the auth_settings for an a single
975
- request; this effectively ignores the
976
- authentication in the spec for a single request.
977
- :type _request_auth: dict, optional
978
- :param _content_type: force content-type for the request.
979
- :type _content_type: str, Optional
980
- :param _headers: set to override the headers for a single
981
- request; this effectively ignores the headers
982
- in the spec for a single request.
983
- :type _headers: dict, optional
984
- :param _host_index: set to override the host_index for a single
985
- request; this effectively ignores the host_index
986
- in the spec for a single request.
987
- :type _host_index: int, optional
988
- :return: Returns the result object.
989
- """ # noqa: E501
990
-
991
- _param = self._get_functions_threat_score_serialize(
992
- threat_score_function_body=threat_score_function_body,
993
- _request_auth=_request_auth,
994
- _content_type=_content_type,
995
- _headers=_headers,
996
- _host_index=_host_index
997
- )
998
-
999
- _response_types_map: Dict[str, Optional[str]] = {
1000
- '200': "BaseResponseListFunctionBoxPlotConfidence",
1001
- '422': "BaseResponse",
1002
- }
1003
- response_data = self.api_client.call_api(
1004
- *_param,
1005
- _request_timeout=_request_timeout
1006
- )
1007
- response_data.read()
1008
- return self.api_client.response_deserialize(
1009
- response_data=response_data,
1010
- response_types_map=_response_types_map,
1011
- )
1012
-
1013
-
1014
- @validate_call
1015
- def get_functions_threat_score_without_preload_content(
1016
- self,
1017
- threat_score_function_body: ThreatScoreFunctionBody,
1018
- _request_timeout: Union[
1019
- None,
1020
- Annotated[StrictFloat, Field(gt=0)],
1021
- Tuple[
1022
- Annotated[StrictFloat, Field(gt=0)],
1023
- Annotated[StrictFloat, Field(gt=0)]
1024
- ]
1025
- ] = None,
1026
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1027
- _content_type: Optional[StrictStr] = None,
1028
- _headers: Optional[Dict[StrictStr, Any]] = None,
1029
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1030
- ) -> RESTResponseType:
1031
- """Calculate Threat Score for a set of Functions
1032
-
1033
- Accepts a list of function ids and returns the threat score for each function. Each function must be from the same model, or you may find some functions missing in the return.
1034
-
1035
- :param threat_score_function_body: (required)
1036
- :type threat_score_function_body: ThreatScoreFunctionBody
1037
- :param _request_timeout: timeout setting for this request. If one
1038
- number provided, it will be total request
1039
- timeout. It can also be a pair (tuple) of
1040
- (connection, read) timeouts.
1041
- :type _request_timeout: int, tuple(int, int), optional
1042
- :param _request_auth: set to override the auth_settings for an a single
1043
- request; this effectively ignores the
1044
- authentication in the spec for a single request.
1045
- :type _request_auth: dict, optional
1046
- :param _content_type: force content-type for the request.
1047
- :type _content_type: str, Optional
1048
- :param _headers: set to override the headers for a single
1049
- request; this effectively ignores the headers
1050
- in the spec for a single request.
1051
- :type _headers: dict, optional
1052
- :param _host_index: set to override the host_index for a single
1053
- request; this effectively ignores the host_index
1054
- in the spec for a single request.
1055
- :type _host_index: int, optional
1056
- :return: Returns the result object.
1057
- """ # noqa: E501
1058
-
1059
- _param = self._get_functions_threat_score_serialize(
1060
- threat_score_function_body=threat_score_function_body,
1061
- _request_auth=_request_auth,
1062
- _content_type=_content_type,
1063
- _headers=_headers,
1064
- _host_index=_host_index
1065
- )
1066
-
1067
- _response_types_map: Dict[str, Optional[str]] = {
1068
- '200': "BaseResponseListFunctionBoxPlotConfidence",
1069
- '422': "BaseResponse",
1070
- }
1071
- response_data = self.api_client.call_api(
1072
- *_param,
1073
- _request_timeout=_request_timeout
1074
- )
1075
- return response_data.response
1076
-
1077
-
1078
- def _get_functions_threat_score_serialize(
1079
- self,
1080
- threat_score_function_body,
1081
- _request_auth,
1082
- _content_type,
1083
- _headers,
1084
- _host_index,
1085
- ) -> RequestSerialized:
1086
-
1087
- _host = None
1088
-
1089
- _collection_formats: Dict[str, str] = {
1090
- }
1091
-
1092
- _path_params: Dict[str, str] = {}
1093
- _query_params: List[Tuple[str, str]] = []
1094
- _header_params: Dict[str, Optional[str]] = _headers or {}
1095
- _form_params: List[Tuple[str, str]] = []
1096
- _files: Dict[
1097
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1098
- ] = {}
1099
- _body_params: Optional[bytes] = None
1100
-
1101
- # process the path parameters
1102
- # process the query parameters
1103
- # process the header parameters
1104
- # process the form parameters
1105
- # process the body parameter
1106
- if threat_score_function_body is not None:
1107
- _body_params = threat_score_function_body
1108
-
1109
-
1110
- # set the HTTP header `Accept`
1111
- if 'Accept' not in _header_params:
1112
- _header_params['Accept'] = self.api_client.select_header_accept(
1113
- [
1114
- 'application/json'
1115
- ]
1116
- )
1117
-
1118
- # set the HTTP header `Content-Type`
1119
- if _content_type:
1120
- _header_params['Content-Type'] = _content_type
1121
- else:
1122
- _default_content_type = (
1123
- self.api_client.select_header_content_type(
1124
- [
1125
- 'application/json'
1126
- ]
1127
- )
1128
- )
1129
- if _default_content_type is not None:
1130
- _header_params['Content-Type'] = _default_content_type
1131
-
1132
- # authentication setting
1133
- _auth_settings: List[str] = [
1134
- 'APIKey'
1135
- ]
1136
-
1137
- return self.api_client.param_serialize(
1138
- method='POST',
1139
- resource_path='/v2/confidence/functions/threat_score',
1140
- path_params=_path_params,
1141
- query_params=_query_params,
1142
- header_params=_header_params,
1143
- body=_body_params,
1144
- post_params=_form_params,
1145
- files=_files,
1146
- auth_settings=_auth_settings,
1147
- collection_formats=_collection_formats,
1148
- _host=_host,
1149
- _request_auth=_request_auth
1150
- )
1151
-
1152
-