From 6fe7348550c91dc30b1c2eabe07012b07ffe3650 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jun 2026 08:17:59 +0000 Subject: [PATCH] Update SDK to version v3.95.1 - Generated from OpenAPI spec version v3.95.1 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 17 +- docs/BatchUpdateDataTypesInputBody.md | 29 ++ docs/BatchUpdateDataTypesItem.md | 31 ++ docs/BatchUpdateDataTypesOutputBody.md | 29 ++ docs/BatchUpdateDataTypesResult.md | 33 ++ docs/FunctionDataTypes.md | 2 +- docs/FunctionDataTypesListItem.md | 2 +- docs/FunctionInfo.md | 30 ++ ...sInner.md => FunctionInfoFuncDepsInner.md} | 16 +- docs/FunctionInfoInput.md | 30 -- docs/FunctionInfoOutput.md | 30 -- .../{FunctionTypeInput.md => FunctionType.md} | 16 +- docs/FunctionTypeOutput.md | 36 -- docs/FunctionsDataTypesApi.md | 165 +++--- docs/UpdateDataTypesInputBody.md | 30 ++ docs/UpdateDataTypesOutputBody.md | 31 ++ docs/UpdateFunctionDataTypes.md | 30 -- revengai/__init__.py | 32 +- revengai/api/functions_data_types_api.py | 475 +++++++++--------- revengai/api_client.py | 2 +- revengai/configuration.py | 4 +- revengai/models/__init__.py | 15 +- .../batch_update_data_types_input_body.py | 113 +++++ ...put.py => batch_update_data_types_item.py} | 52 +- .../batch_update_data_types_output_body.py | 112 +++++ .../models/batch_update_data_types_result.py | 119 +++++ revengai/models/function_data_types.py | 6 +- .../models/function_data_types_list_item.py | 6 +- ...unction_info_input.py => function_info.py} | 20 +- ...er.py => function_info_func_deps_inner.py} | 12 +- ...unction_type_input.py => function_type.py} | 8 +- revengai/models/function_type_output.py | 127 ----- .../models/update_data_types_input_body.py | 107 ++++ ...es.py => update_data_types_output_body.py} | 42 +- 35 files changed, 1130 insertions(+), 681 deletions(-) create mode 100644 docs/BatchUpdateDataTypesInputBody.md create mode 100644 docs/BatchUpdateDataTypesItem.md create mode 100644 docs/BatchUpdateDataTypesOutputBody.md create mode 100644 docs/BatchUpdateDataTypesResult.md create mode 100644 docs/FunctionInfo.md rename docs/{FunctionInfoInputFuncDepsInner.md => FunctionInfoFuncDepsInner.md} (58%) delete mode 100644 docs/FunctionInfoInput.md delete mode 100644 docs/FunctionInfoOutput.md rename docs/{FunctionTypeInput.md => FunctionType.md} (68%) delete mode 100644 docs/FunctionTypeOutput.md create mode 100644 docs/UpdateDataTypesInputBody.md create mode 100644 docs/UpdateDataTypesOutputBody.md delete mode 100644 docs/UpdateFunctionDataTypes.md create mode 100644 revengai/models/batch_update_data_types_input_body.py rename revengai/models/{function_info_output.py => batch_update_data_types_item.py} (61%) create mode 100644 revengai/models/batch_update_data_types_output_body.py create mode 100644 revengai/models/batch_update_data_types_result.py rename revengai/models/{function_info_input.py => function_info.py} (80%) rename revengai/models/{function_info_input_func_deps_inner.py => function_info_func_deps_inner.py} (90%) rename revengai/models/{function_type_input.py => function_type.py} (96%) delete mode 100644 revengai/models/function_type_output.py create mode 100644 revengai/models/update_data_types_input_body.py rename revengai/models/{update_function_data_types.py => update_data_types_output_body.py} (62%) diff --git a/.sdk-version b/.sdk-version index f6a594d5..e5bccb11 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.94.1 +v3.95.1 diff --git a/README.md b/README.md index 8db9e642..22034e3e 100644 --- a/README.md +++ b/README.md @@ -158,12 +158,12 @@ Class | Method | HTTP request | Description *FunctionsCoreApi* | [**get_function_details**](docs/FunctionsCoreApi.md#get_function_details) | **GET** /v2/functions/{function_id} | Get function details *FunctionsCoreApi* | [**get_function_strings**](docs/FunctionsCoreApi.md#get_function_strings) | **GET** /v2/functions/{function_id}/strings | Get string information found in the function *FunctionsCoreApi* | [**get_function_strings_0**](docs/FunctionsCoreApi.md#get_function_strings_0) | **GET** /v3/functions/{function_id}/strings | List strings for a function. +*FunctionsDataTypesApi* | [**batch_update_function_data_types**](docs/FunctionsDataTypesApi.md#batch_update_function_data_types) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types *FunctionsDataTypesApi* | [**generate_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types *FunctionsDataTypesApi* | [**generate_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions *FunctionsDataTypesApi* | [**get_function_data_types**](docs/FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types *FunctionsDataTypesApi* | [**list_function_data_types_for_analysis**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_analysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types *FunctionsDataTypesApi* | [**list_function_data_types_for_functions**](docs/FunctionsDataTypesApi.md#list_function_data_types_for_functions) | **GET** /v2/functions/data_types | List Function Data Types -*FunctionsDataTypesApi* | [**update_function_data_types**](docs/FunctionsDataTypesApi.md#update_function_data_types) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update Function Data Types *FunctionsRenamingHistoryApi* | [**batch_rename_function**](docs/FunctionsRenamingHistoryApi.md#batch_rename_function) | **POST** /v2/functions/rename/batch | Batch Rename Functions *FunctionsRenamingHistoryApi* | [**batch_rename_functions**](docs/FunctionsRenamingHistoryApi.md#batch_rename_functions) | **POST** /v3/functions/rename | Batch rename functions *FunctionsRenamingHistoryApi* | [**get_function_history**](docs/FunctionsRenamingHistoryApi.md#get_function_history) | **GET** /v3/functions/{function_id}/history | Get function name history @@ -304,6 +304,10 @@ Class | Method | HTTP request | Description - [BatchRenameInputBody](docs/BatchRenameInputBody.md) - [BatchRenameItem](docs/BatchRenameItem.md) - [BatchRenameOutputBody](docs/BatchRenameOutputBody.md) + - [BatchUpdateDataTypesInputBody](docs/BatchUpdateDataTypesInputBody.md) + - [BatchUpdateDataTypesItem](docs/BatchUpdateDataTypesItem.md) + - [BatchUpdateDataTypesOutputBody](docs/BatchUpdateDataTypesOutputBody.md) + - [BatchUpdateDataTypesResult](docs/BatchUpdateDataTypesResult.md) - [BinariesRelatedStatusResponse](docs/BinariesRelatedStatusResponse.md) - [BinariesTaskStatus](docs/BinariesTaskStatus.md) - [Binary](docs/Binary.md) @@ -422,9 +426,8 @@ Class | Method | HTTP request | Description - [FunctionDataTypesParams](docs/FunctionDataTypesParams.md) - [FunctionDataTypesStatus](docs/FunctionDataTypesStatus.md) - [FunctionHeader](docs/FunctionHeader.md) - - [FunctionInfoInput](docs/FunctionInfoInput.md) - - [FunctionInfoInputFuncDepsInner](docs/FunctionInfoInputFuncDepsInner.md) - - [FunctionInfoOutput](docs/FunctionInfoOutput.md) + - [FunctionInfo](docs/FunctionInfo.md) + - [FunctionInfoFuncDepsInner](docs/FunctionInfoFuncDepsInner.md) - [FunctionListItem](docs/FunctionListItem.md) - [FunctionLocalVariableResponse](docs/FunctionLocalVariableResponse.md) - [FunctionMapping](docs/FunctionMapping.md) @@ -442,8 +445,7 @@ Class | Method | HTTP request | Description - [FunctionString](docs/FunctionString.md) - [FunctionStringItem](docs/FunctionStringItem.md) - [FunctionStringsResponse](docs/FunctionStringsResponse.md) - - [FunctionTypeInput](docs/FunctionTypeInput.md) - - [FunctionTypeOutput](docs/FunctionTypeOutput.md) + - [FunctionType](docs/FunctionType.md) - [FunctionsDetailResponse](docs/FunctionsDetailResponse.md) - [FunctionsListRename](docs/FunctionsListRename.md) - [GenerateFunctionDataTypes](docs/GenerateFunctionDataTypes.md) @@ -587,7 +589,8 @@ Class | Method | HTTP request | Description - [TriggerDynamicExecutionInputBody](docs/TriggerDynamicExecutionInputBody.md) - [Ttp](docs/Ttp.md) - [TypeDefinition](docs/TypeDefinition.md) - - [UpdateFunctionDataTypes](docs/UpdateFunctionDataTypes.md) + - [UpdateDataTypesInputBody](docs/UpdateDataTypesInputBody.md) + - [UpdateDataTypesOutputBody](docs/UpdateDataTypesOutputBody.md) - [UploadFileType](docs/UploadFileType.md) - [UploadResponse](docs/UploadResponse.md) - [UpsertAiDecomplationRatingRequest](docs/UpsertAiDecomplationRatingRequest.md) diff --git a/docs/BatchUpdateDataTypesInputBody.md b/docs/BatchUpdateDataTypesInputBody.md new file mode 100644 index 00000000..f351805a --- /dev/null +++ b/docs/BatchUpdateDataTypesInputBody.md @@ -0,0 +1,29 @@ +# BatchUpdateDataTypesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[BatchUpdateDataTypesItem]**](BatchUpdateDataTypesItem.md) | List of functions to update. All function IDs must belong to the analysis in the URL. | + +## Example + +```python +from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchUpdateDataTypesInputBody from a JSON string +batch_update_data_types_input_body_instance = BatchUpdateDataTypesInputBody.from_json(json) +# print the JSON string representation of the object +print(BatchUpdateDataTypesInputBody.to_json()) + +# convert the object into a dict +batch_update_data_types_input_body_dict = batch_update_data_types_input_body_instance.to_dict() +# create an instance of BatchUpdateDataTypesInputBody from a dict +batch_update_data_types_input_body_from_dict = BatchUpdateDataTypesInputBody.from_dict(batch_update_data_types_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateDataTypesItem.md b/docs/BatchUpdateDataTypesItem.md new file mode 100644 index 00000000..f23a885b --- /dev/null +++ b/docs/BatchUpdateDataTypesItem.md @@ -0,0 +1,31 @@ +# BatchUpdateDataTypesItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | **object** | | +**data_types_version** | **int** | Current stored version. Pass 0 on the first write. | +**function_id** | **int** | Function ID | + +## Example + +```python +from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchUpdateDataTypesItem from a JSON string +batch_update_data_types_item_instance = BatchUpdateDataTypesItem.from_json(json) +# print the JSON string representation of the object +print(BatchUpdateDataTypesItem.to_json()) + +# convert the object into a dict +batch_update_data_types_item_dict = batch_update_data_types_item_instance.to_dict() +# create an instance of BatchUpdateDataTypesItem from a dict +batch_update_data_types_item_from_dict = BatchUpdateDataTypesItem.from_dict(batch_update_data_types_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateDataTypesOutputBody.md b/docs/BatchUpdateDataTypesOutputBody.md new file mode 100644 index 00000000..de881636 --- /dev/null +++ b/docs/BatchUpdateDataTypesOutputBody.md @@ -0,0 +1,29 @@ +# BatchUpdateDataTypesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[BatchUpdateDataTypesResult]**](BatchUpdateDataTypesResult.md) | Per-function outcomes in the same order as the input | + +## Example + +```python +from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchUpdateDataTypesOutputBody from a JSON string +batch_update_data_types_output_body_instance = BatchUpdateDataTypesOutputBody.from_json(json) +# print the JSON string representation of the object +print(BatchUpdateDataTypesOutputBody.to_json()) + +# convert the object into a dict +batch_update_data_types_output_body_dict = batch_update_data_types_output_body_instance.to_dict() +# create an instance of BatchUpdateDataTypesOutputBody from a dict +batch_update_data_types_output_body_from_dict = BatchUpdateDataTypesOutputBody.from_dict(batch_update_data_types_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateDataTypesResult.md b/docs/BatchUpdateDataTypesResult.md new file mode 100644 index 00000000..099b2ede --- /dev/null +++ b/docs/BatchUpdateDataTypesResult.md @@ -0,0 +1,33 @@ +# BatchUpdateDataTypesResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | **object** | | [optional] +**data_types_version** | **int** | Version after update (present when status is 'updated') | [optional] +**error** | **str** | Error message (present when status is 'error') | [optional] +**function_id** | **int** | Function ID | +**status** | **str** | Outcome for this function | + +## Example + +```python +from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchUpdateDataTypesResult from a JSON string +batch_update_data_types_result_instance = BatchUpdateDataTypesResult.from_json(json) +# print the JSON string representation of the object +print(BatchUpdateDataTypesResult.to_json()) + +# convert the object into a dict +batch_update_data_types_result_dict = batch_update_data_types_result_instance.to_dict() +# create an instance of BatchUpdateDataTypesResult from a dict +batch_update_data_types_result_from_dict = BatchUpdateDataTypesResult.from_dict(batch_update_data_types_result_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionDataTypes.md b/docs/FunctionDataTypes.md index 146896e6..d5af1bf8 100644 --- a/docs/FunctionDataTypes.md +++ b/docs/FunctionDataTypes.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **completed** | **bool** | Whether the service has completed data types generation | **status** | **str** | The current status of the data types service | -**data_types** | [**FunctionInfoOutput**](FunctionInfoOutput.md) | | [optional] +**data_types** | [**FunctionInfo**](FunctionInfo.md) | | [optional] **data_types_version** | **int** | | [optional] ## Example diff --git a/docs/FunctionDataTypesListItem.md b/docs/FunctionDataTypesListItem.md index 9daf7577..8c4b2b50 100644 --- a/docs/FunctionDataTypesListItem.md +++ b/docs/FunctionDataTypesListItem.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **completed** | **bool** | Whether the service has completed data types generation | **status** | **str** | The current status of the data types service | -**data_types** | [**FunctionInfoOutput**](FunctionInfoOutput.md) | | [optional] +**data_types** | [**FunctionInfo**](FunctionInfo.md) | | [optional] **data_types_version** | **int** | | [optional] **function_id** | **int** | Function id | diff --git a/docs/FunctionInfo.md b/docs/FunctionInfo.md new file mode 100644 index 00000000..0e14caa7 --- /dev/null +++ b/docs/FunctionInfo.md @@ -0,0 +1,30 @@ +# FunctionInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**func_types** | [**FunctionType**](FunctionType.md) | | [optional] +**func_deps** | [**List[FunctionInfoFuncDepsInner]**](FunctionInfoFuncDepsInner.md) | List of function dependencies | + +## Example + +```python +from revengai.models.function_info import FunctionInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of FunctionInfo from a JSON string +function_info_instance = FunctionInfo.from_json(json) +# print the JSON string representation of the object +print(FunctionInfo.to_json()) + +# convert the object into a dict +function_info_dict = function_info_instance.to_dict() +# create an instance of FunctionInfo from a dict +function_info_from_dict = FunctionInfo.from_dict(function_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FunctionInfoInputFuncDepsInner.md b/docs/FunctionInfoFuncDepsInner.md similarity index 58% rename from docs/FunctionInfoInputFuncDepsInner.md rename to docs/FunctionInfoFuncDepsInner.md index 7a431f1f..4d728a23 100644 --- a/docs/FunctionInfoInputFuncDepsInner.md +++ b/docs/FunctionInfoFuncDepsInner.md @@ -1,4 +1,4 @@ -# FunctionInfoInputFuncDepsInner +# FunctionInfoFuncDepsInner ## Properties @@ -16,19 +16,19 @@ Name | Type | Description | Notes ## Example ```python -from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner +from revengai.models.function_info_func_deps_inner import FunctionInfoFuncDepsInner # TODO update the JSON string below json = "{}" -# create an instance of FunctionInfoInputFuncDepsInner from a JSON string -function_info_input_func_deps_inner_instance = FunctionInfoInputFuncDepsInner.from_json(json) +# create an instance of FunctionInfoFuncDepsInner from a JSON string +function_info_func_deps_inner_instance = FunctionInfoFuncDepsInner.from_json(json) # print the JSON string representation of the object -print(FunctionInfoInputFuncDepsInner.to_json()) +print(FunctionInfoFuncDepsInner.to_json()) # convert the object into a dict -function_info_input_func_deps_inner_dict = function_info_input_func_deps_inner_instance.to_dict() -# create an instance of FunctionInfoInputFuncDepsInner from a dict -function_info_input_func_deps_inner_from_dict = FunctionInfoInputFuncDepsInner.from_dict(function_info_input_func_deps_inner_dict) +function_info_func_deps_inner_dict = function_info_func_deps_inner_instance.to_dict() +# create an instance of FunctionInfoFuncDepsInner from a dict +function_info_func_deps_inner_from_dict = FunctionInfoFuncDepsInner.from_dict(function_info_func_deps_inner_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FunctionInfoInput.md b/docs/FunctionInfoInput.md deleted file mode 100644 index 0b4e882c..00000000 --- a/docs/FunctionInfoInput.md +++ /dev/null @@ -1,30 +0,0 @@ -# FunctionInfoInput - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**func_types** | [**FunctionTypeInput**](FunctionTypeInput.md) | | [optional] -**func_deps** | [**List[FunctionInfoInputFuncDepsInner]**](FunctionInfoInputFuncDepsInner.md) | List of function dependencies | - -## Example - -```python -from revengai.models.function_info_input import FunctionInfoInput - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionInfoInput from a JSON string -function_info_input_instance = FunctionInfoInput.from_json(json) -# print the JSON string representation of the object -print(FunctionInfoInput.to_json()) - -# convert the object into a dict -function_info_input_dict = function_info_input_instance.to_dict() -# create an instance of FunctionInfoInput from a dict -function_info_input_from_dict = FunctionInfoInput.from_dict(function_info_input_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionInfoOutput.md b/docs/FunctionInfoOutput.md deleted file mode 100644 index 4e73bb82..00000000 --- a/docs/FunctionInfoOutput.md +++ /dev/null @@ -1,30 +0,0 @@ -# FunctionInfoOutput - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**func_types** | [**FunctionTypeOutput**](FunctionTypeOutput.md) | | [optional] -**func_deps** | [**List[FunctionInfoInputFuncDepsInner]**](FunctionInfoInputFuncDepsInner.md) | List of function dependencies | - -## Example - -```python -from revengai.models.function_info_output import FunctionInfoOutput - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionInfoOutput from a JSON string -function_info_output_instance = FunctionInfoOutput.from_json(json) -# print the JSON string representation of the object -print(FunctionInfoOutput.to_json()) - -# convert the object into a dict -function_info_output_dict = function_info_output_instance.to_dict() -# create an instance of FunctionInfoOutput from a dict -function_info_output_from_dict = FunctionInfoOutput.from_dict(function_info_output_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionTypeInput.md b/docs/FunctionType.md similarity index 68% rename from docs/FunctionTypeInput.md rename to docs/FunctionType.md index d3c937ec..0f9c9083 100644 --- a/docs/FunctionTypeInput.md +++ b/docs/FunctionType.md @@ -1,4 +1,4 @@ -# FunctionTypeInput +# FunctionType ## Properties @@ -17,19 +17,19 @@ Name | Type | Description | Notes ## Example ```python -from revengai.models.function_type_input import FunctionTypeInput +from revengai.models.function_type import FunctionType # TODO update the JSON string below json = "{}" -# create an instance of FunctionTypeInput from a JSON string -function_type_input_instance = FunctionTypeInput.from_json(json) +# create an instance of FunctionType from a JSON string +function_type_instance = FunctionType.from_json(json) # print the JSON string representation of the object -print(FunctionTypeInput.to_json()) +print(FunctionType.to_json()) # convert the object into a dict -function_type_input_dict = function_type_input_instance.to_dict() -# create an instance of FunctionTypeInput from a dict -function_type_input_from_dict = FunctionTypeInput.from_dict(function_type_input_dict) +function_type_dict = function_type_instance.to_dict() +# create an instance of FunctionType from a dict +function_type_from_dict = FunctionType.from_dict(function_type_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FunctionTypeOutput.md b/docs/FunctionTypeOutput.md deleted file mode 100644 index 26a70396..00000000 --- a/docs/FunctionTypeOutput.md +++ /dev/null @@ -1,36 +0,0 @@ -# FunctionTypeOutput - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**last_change** | **str** | | [optional] -**addr** | **int** | Memory address of the function | -**size** | **int** | Size of the function in bytes | -**header** | [**FunctionHeader**](FunctionHeader.md) | Function header information | -**stack_vars** | [**Dict[str, StackVariable]**](StackVariable.md) | | [optional] -**name** | **str** | Name of the function | -**type** | **str** | Return type of the function | -**artifact_type** | **str** | Type of artifact that the structure is associated with | [optional] [default to 'Function'] - -## Example - -```python -from revengai.models.function_type_output import FunctionTypeOutput - -# TODO update the JSON string below -json = "{}" -# create an instance of FunctionTypeOutput from a JSON string -function_type_output_instance = FunctionTypeOutput.from_json(json) -# print the JSON string representation of the object -print(FunctionTypeOutput.to_json()) - -# convert the object into a dict -function_type_output_dict = function_type_output_instance.to_dict() -# create an instance of FunctionTypeOutput from a dict -function_type_output_from_dict = FunctionTypeOutput.from_dict(function_type_output_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FunctionsDataTypesApi.md b/docs/FunctionsDataTypesApi.md index d702e30c..88d93a94 100644 --- a/docs/FunctionsDataTypesApi.md +++ b/docs/FunctionsDataTypesApi.md @@ -4,20 +4,25 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**batch_update_function_data_types**](FunctionsDataTypesApi.md#batch_update_function_data_types) | **PUT** /v3/analyses/{analysis_id}/functions/data-types | Batch update function data types [**generate_function_data_types_for_analysis**](FunctionsDataTypesApi.md#generate_function_data_types_for_analysis) | **POST** /v2/analyses/{analysis_id}/functions/data_types | Generate Function Data Types [**generate_function_data_types_for_functions**](FunctionsDataTypesApi.md#generate_function_data_types_for_functions) | **POST** /v2/functions/data_types | Generate Function Data Types for an arbitrary list of functions [**get_function_data_types**](FunctionsDataTypesApi.md#get_function_data_types) | **GET** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Get Function Data Types [**list_function_data_types_for_analysis**](FunctionsDataTypesApi.md#list_function_data_types_for_analysis) | **GET** /v2/analyses/{analysis_id}/functions/data_types | List Function Data Types [**list_function_data_types_for_functions**](FunctionsDataTypesApi.md#list_function_data_types_for_functions) | **GET** /v2/functions/data_types | List Function Data Types -[**update_function_data_types**](FunctionsDataTypesApi.md#update_function_data_types) | **PUT** /v2/analyses/{analysis_id}/functions/{function_id}/data_types | Update Function Data Types -# **generate_function_data_types_for_analysis** -> BaseResponseGenerateFunctionDataTypes generate_function_data_types_for_analysis(analysis_id, function_data_types_params) +# **batch_update_function_data_types** +> BatchUpdateDataTypesOutputBody batch_update_function_data_types(analysis_id, batch_update_data_types_input_body) -Generate Function Data Types +Batch update function data types -Submits a request to generate the function data types +Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. + +**Error codes:** +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request ### Example @@ -25,8 +30,8 @@ Submits a request to generate the function data types ```python import revengai -from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes -from revengai.models.function_data_types_params import FunctionDataTypesParams +from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody +from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody from revengai.rest import ApiException from pprint import pprint @@ -51,16 +56,16 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | - function_data_types_params = revengai.FunctionDataTypesParams() # FunctionDataTypesParams | + analysis_id = 56 # int | Analysis ID + batch_update_data_types_input_body = revengai.BatchUpdateDataTypesInputBody() # BatchUpdateDataTypesInputBody | try: - # Generate Function Data Types - api_response = api_instance.generate_function_data_types_for_analysis(analysis_id, function_data_types_params) - print("The response of FunctionsDataTypesApi->generate_function_data_types_for_analysis:\n") + # Batch update function data types + api_response = api_instance.batch_update_function_data_types(analysis_id, batch_update_data_types_input_body) + print("The response of FunctionsDataTypesApi->batch_update_function_data_types:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_analysis: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->batch_update_function_data_types: %s\n" % e) ``` @@ -70,12 +75,12 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **function_data_types_params** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | + **analysis_id** | **int**| Analysis ID | + **batch_update_data_types_input_body** | [**BatchUpdateDataTypesInputBody**](BatchUpdateDataTypesInputBody.md)| | ### Return type -[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) +[**BatchUpdateDataTypesOutputBody**](BatchUpdateDataTypesOutputBody.md) ### Authorization @@ -90,15 +95,19 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Successful Response | - | -**422** | Invalid request parameters | - | +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**500** | Internal Server Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **generate_function_data_types_for_functions** -> BaseResponseGenerationStatusList generate_function_data_types_for_functions(function_data_types_params) +# **generate_function_data_types_for_analysis** +> BaseResponseGenerateFunctionDataTypes generate_function_data_types_for_analysis(analysis_id, function_data_types_params) -Generate Function Data Types for an arbitrary list of functions +Generate Function Data Types Submits a request to generate the function data types @@ -108,7 +117,7 @@ Submits a request to generate the function data types ```python import revengai -from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList +from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes from revengai.models.function_data_types_params import FunctionDataTypesParams from revengai.rest import ApiException from pprint import pprint @@ -134,15 +143,16 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) + analysis_id = 56 # int | function_data_types_params = revengai.FunctionDataTypesParams() # FunctionDataTypesParams | try: - # Generate Function Data Types for an arbitrary list of functions - api_response = api_instance.generate_function_data_types_for_functions(function_data_types_params) - print("The response of FunctionsDataTypesApi->generate_function_data_types_for_functions:\n") + # Generate Function Data Types + api_response = api_instance.generate_function_data_types_for_analysis(analysis_id, function_data_types_params) + print("The response of FunctionsDataTypesApi->generate_function_data_types_for_analysis:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_functions: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_analysis: %s\n" % e) ``` @@ -152,11 +162,12 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| | **function_data_types_params** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | ### Return type -[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) +[**BaseResponseGenerateFunctionDataTypes**](BaseResponseGenerateFunctionDataTypes.md) ### Authorization @@ -176,12 +187,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_function_data_types** -> BaseResponseFunctionDataTypes get_function_data_types(analysis_id, function_id) +# **generate_function_data_types_for_functions** +> BaseResponseGenerationStatusList generate_function_data_types_for_functions(function_data_types_params) -Get Function Data Types +Generate Function Data Types for an arbitrary list of functions -Polling endpoint which returns the current status of function generation and once completed the data type information +Submits a request to generate the function data types ### Example @@ -189,7 +200,8 @@ Polling endpoint which returns the current status of function generation and onc ```python import revengai -from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes +from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList +from revengai.models.function_data_types_params import FunctionDataTypesParams from revengai.rest import ApiException from pprint import pprint @@ -214,16 +226,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | - function_id = 56 # int | + function_data_types_params = revengai.FunctionDataTypesParams() # FunctionDataTypesParams | try: - # Get Function Data Types - api_response = api_instance.get_function_data_types(analysis_id, function_id) - print("The response of FunctionsDataTypesApi->get_function_data_types:\n") + # Generate Function Data Types for an arbitrary list of functions + api_response = api_instance.generate_function_data_types_for_functions(function_data_types_params) + print("The response of FunctionsDataTypesApi->generate_function_data_types_for_functions:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->get_function_data_types: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->generate_function_data_types_for_functions: %s\n" % e) ``` @@ -233,12 +244,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **function_id** | **int**| | + **function_data_types_params** | [**FunctionDataTypesParams**](FunctionDataTypesParams.md)| | ### Return type -[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) +[**BaseResponseGenerationStatusList**](BaseResponseGenerationStatusList.md) ### Authorization @@ -246,24 +256,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successful Response | - | +**201** | Successful Response | - | **422** | Invalid request parameters | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_function_data_types_for_analysis** -> BaseResponseFunctionDataTypesList list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) +# **get_function_data_types** +> BaseResponseFunctionDataTypes get_function_data_types(analysis_id, function_id) -List Function Data Types +Get Function Data Types -Returns data types for multiple functions with optional function ID filtering +Polling endpoint which returns the current status of function generation and once completed the data type information ### Example @@ -271,7 +281,7 @@ Returns data types for multiple functions with optional function ID filtering ```python import revengai -from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList +from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes from revengai.rest import ApiException from pprint import pprint @@ -297,15 +307,15 @@ with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) analysis_id = 56 # int | - function_ids = [56] # List[Optional[int]] | (optional) + function_id = 56 # int | try: - # List Function Data Types - api_response = api_instance.list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) - print("The response of FunctionsDataTypesApi->list_function_data_types_for_analysis:\n") + # Get Function Data Types + api_response = api_instance.get_function_data_types(analysis_id, function_id) + print("The response of FunctionsDataTypesApi->get_function_data_types:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_analysis: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->get_function_data_types: %s\n" % e) ``` @@ -316,11 +326,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_id** | **int**| | - **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] + **function_id** | **int**| | ### Return type -[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) +[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) ### Authorization @@ -340,12 +350,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_function_data_types_for_functions** -> BaseResponseFunctionDataTypesList list_function_data_types_for_functions(function_ids=function_ids) +# **list_function_data_types_for_analysis** +> BaseResponseFunctionDataTypesList list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) List Function Data Types -Returns data types for multiple function IDs +Returns data types for multiple functions with optional function ID filtering ### Example @@ -378,15 +388,16 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) + analysis_id = 56 # int | function_ids = [56] # List[Optional[int]] | (optional) try: # List Function Data Types - api_response = api_instance.list_function_data_types_for_functions(function_ids=function_ids) - print("The response of FunctionsDataTypesApi->list_function_data_types_for_functions:\n") + api_response = api_instance.list_function_data_types_for_analysis(analysis_id, function_ids=function_ids) + print("The response of FunctionsDataTypesApi->list_function_data_types_for_analysis:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_functions: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_analysis: %s\n" % e) ``` @@ -396,6 +407,7 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **analysis_id** | **int**| | **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] ### Return type @@ -420,12 +432,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_function_data_types** -> BaseResponseFunctionDataTypes update_function_data_types(analysis_id, function_id, update_function_data_types) +# **list_function_data_types_for_functions** +> BaseResponseFunctionDataTypesList list_function_data_types_for_functions(function_ids=function_ids) -Update Function Data Types +List Function Data Types -Updates the function data types for a given function +Returns data types for multiple function IDs ### Example @@ -433,8 +445,7 @@ Updates the function data types for a given function ```python import revengai -from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes -from revengai.models.update_function_data_types import UpdateFunctionDataTypes +from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList from revengai.rest import ApiException from pprint import pprint @@ -459,17 +470,15 @@ configuration.api_key['APIKey'] = os.environ["API_KEY"] with revengai.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = revengai.FunctionsDataTypesApi(api_client) - analysis_id = 56 # int | - function_id = 56 # int | - update_function_data_types = revengai.UpdateFunctionDataTypes() # UpdateFunctionDataTypes | + function_ids = [56] # List[Optional[int]] | (optional) try: - # Update Function Data Types - api_response = api_instance.update_function_data_types(analysis_id, function_id, update_function_data_types) - print("The response of FunctionsDataTypesApi->update_function_data_types:\n") + # List Function Data Types + api_response = api_instance.list_function_data_types_for_functions(function_ids=function_ids) + print("The response of FunctionsDataTypesApi->list_function_data_types_for_functions:\n") pprint(api_response) except Exception as e: - print("Exception when calling FunctionsDataTypesApi->update_function_data_types: %s\n" % e) + print("Exception when calling FunctionsDataTypesApi->list_function_data_types_for_functions: %s\n" % e) ``` @@ -479,13 +488,11 @@ with revengai.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **analysis_id** | **int**| | - **function_id** | **int**| | - **update_function_data_types** | [**UpdateFunctionDataTypes**](UpdateFunctionDataTypes.md)| | + **function_ids** | [**List[Optional[int]]**](int.md)| | [optional] ### Return type -[**BaseResponseFunctionDataTypes**](BaseResponseFunctionDataTypes.md) +[**BaseResponseFunctionDataTypesList**](BaseResponseFunctionDataTypesList.md) ### Authorization @@ -493,7 +500,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details diff --git a/docs/UpdateDataTypesInputBody.md b/docs/UpdateDataTypesInputBody.md new file mode 100644 index 00000000..b79a4c5d --- /dev/null +++ b/docs/UpdateDataTypesInputBody.md @@ -0,0 +1,30 @@ +# UpdateDataTypesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | **object** | | +**data_types_version** | **int** | Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write. | + +## Example + +```python +from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDataTypesInputBody from a JSON string +update_data_types_input_body_instance = UpdateDataTypesInputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateDataTypesInputBody.to_json()) + +# convert the object into a dict +update_data_types_input_body_dict = update_data_types_input_body_instance.to_dict() +# create an instance of UpdateDataTypesInputBody from a dict +update_data_types_input_body_from_dict = UpdateDataTypesInputBody.from_dict(update_data_types_input_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDataTypesOutputBody.md b/docs/UpdateDataTypesOutputBody.md new file mode 100644 index 00000000..7118aeab --- /dev/null +++ b/docs/UpdateDataTypesOutputBody.md @@ -0,0 +1,31 @@ +# UpdateDataTypesOutputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_types** | **object** | | +**data_types_version** | **int** | Version of the stored function data types after the update | +**function_id** | **int** | Function ID | + +## Example + +```python +from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDataTypesOutputBody from a JSON string +update_data_types_output_body_instance = UpdateDataTypesOutputBody.from_json(json) +# print the JSON string representation of the object +print(UpdateDataTypesOutputBody.to_json()) + +# convert the object into a dict +update_data_types_output_body_dict = update_data_types_output_body_instance.to_dict() +# create an instance of UpdateDataTypesOutputBody from a dict +update_data_types_output_body_from_dict = UpdateDataTypesOutputBody.from_dict(update_data_types_output_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateFunctionDataTypes.md b/docs/UpdateFunctionDataTypes.md deleted file mode 100644 index 97dcf0e1..00000000 --- a/docs/UpdateFunctionDataTypes.md +++ /dev/null @@ -1,30 +0,0 @@ -# UpdateFunctionDataTypes - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_types_version** | **int** | Version of the function data types, used to check this update is not overwriting a newer one | -**data_types** | [**FunctionInfoInput**](FunctionInfoInput.md) | Function data types information to update | - -## Example - -```python -from revengai.models.update_function_data_types import UpdateFunctionDataTypes - -# TODO update the JSON string below -json = "{}" -# create an instance of UpdateFunctionDataTypes from a JSON string -update_function_data_types_instance = UpdateFunctionDataTypes.from_json(json) -# print the JSON string representation of the object -print(UpdateFunctionDataTypes.to_json()) - -# convert the object into a dict -update_function_data_types_dict = update_function_data_types_instance.to_dict() -# create an instance of UpdateFunctionDataTypes from a dict -update_function_data_types_from_dict = UpdateFunctionDataTypes.from_dict(update_function_data_types_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/revengai/__init__.py b/revengai/__init__.py index ac6733e4..245411c6 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.94.1" +__version__ = "v3.95.1" # Define package exports __all__ = [ @@ -166,6 +166,10 @@ "BatchRenameInputBody", "BatchRenameItem", "BatchRenameOutputBody", + "BatchUpdateDataTypesInputBody", + "BatchUpdateDataTypesItem", + "BatchUpdateDataTypesOutputBody", + "BatchUpdateDataTypesResult", "BinariesRelatedStatusResponse", "BinariesTaskStatus", "Binary", @@ -284,9 +288,8 @@ "FunctionDataTypesParams", "FunctionDataTypesStatus", "FunctionHeader", - "FunctionInfoInput", - "FunctionInfoInputFuncDepsInner", - "FunctionInfoOutput", + "FunctionInfo", + "FunctionInfoFuncDepsInner", "FunctionListItem", "FunctionLocalVariableResponse", "FunctionMapping", @@ -304,8 +307,7 @@ "FunctionString", "FunctionStringItem", "FunctionStringsResponse", - "FunctionTypeInput", - "FunctionTypeOutput", + "FunctionType", "FunctionsDetailResponse", "FunctionsListRename", "GenerateFunctionDataTypes", @@ -449,7 +451,8 @@ "TriggerDynamicExecutionInputBody", "Ttp", "TypeDefinition", - "UpdateFunctionDataTypes", + "UpdateDataTypesInputBody", + "UpdateDataTypesOutputBody", "UploadFileType", "UploadResponse", "UpsertAiDecomplationRatingRequest", @@ -620,6 +623,10 @@ from revengai.models.batch_rename_input_body import BatchRenameInputBody as BatchRenameInputBody from revengai.models.batch_rename_item import BatchRenameItem as BatchRenameItem from revengai.models.batch_rename_output_body import BatchRenameOutputBody as BatchRenameOutputBody +from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody as BatchUpdateDataTypesInputBody +from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem as BatchUpdateDataTypesItem +from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody as BatchUpdateDataTypesOutputBody +from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult as BatchUpdateDataTypesResult from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse as BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus as BinariesTaskStatus from revengai.models.binary import Binary as Binary @@ -738,9 +745,8 @@ from revengai.models.function_data_types_params import FunctionDataTypesParams as FunctionDataTypesParams from revengai.models.function_data_types_status import FunctionDataTypesStatus as FunctionDataTypesStatus from revengai.models.function_header import FunctionHeader as FunctionHeader -from revengai.models.function_info_input import FunctionInfoInput as FunctionInfoInput -from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner as FunctionInfoInputFuncDepsInner -from revengai.models.function_info_output import FunctionInfoOutput as FunctionInfoOutput +from revengai.models.function_info import FunctionInfo as FunctionInfo +from revengai.models.function_info_func_deps_inner import FunctionInfoFuncDepsInner as FunctionInfoFuncDepsInner from revengai.models.function_list_item import FunctionListItem as FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse as FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping as FunctionMapping @@ -758,8 +764,7 @@ from revengai.models.function_string import FunctionString as FunctionString from revengai.models.function_string_item import FunctionStringItem as FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse as FunctionStringsResponse -from revengai.models.function_type_input import FunctionTypeInput as FunctionTypeInput -from revengai.models.function_type_output import FunctionTypeOutput as FunctionTypeOutput +from revengai.models.function_type import FunctionType as FunctionType from revengai.models.functions_detail_response import FunctionsDetailResponse as FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename as FunctionsListRename from revengai.models.generate_function_data_types import GenerateFunctionDataTypes as GenerateFunctionDataTypes @@ -903,7 +908,8 @@ from revengai.models.trigger_dynamic_execution_input_body import TriggerDynamicExecutionInputBody as TriggerDynamicExecutionInputBody from revengai.models.ttp import Ttp as Ttp from revengai.models.type_definition import TypeDefinition as TypeDefinition -from revengai.models.update_function_data_types import UpdateFunctionDataTypes as UpdateFunctionDataTypes +from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody as UpdateDataTypesInputBody +from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody as UpdateDataTypesOutputBody from revengai.models.upload_file_type import UploadFileType as UploadFileType from revengai.models.upload_response import UploadResponse as UploadResponse from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest as UpsertAiDecomplationRatingRequest diff --git a/revengai/api/functions_data_types_api.py b/revengai/api/functions_data_types_api.py index 2308516b..6a86e21d 100644 --- a/revengai/api/functions_data_types_api.py +++ b/revengai/api/functions_data_types_api.py @@ -15,14 +15,16 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt +from pydantic import Field, StrictInt from typing import List, Optional +from typing_extensions import Annotated from revengai.models.base_response_function_data_types import BaseResponseFunctionDataTypes from revengai.models.base_response_function_data_types_list import BaseResponseFunctionDataTypesList from revengai.models.base_response_generate_function_data_types import BaseResponseGenerateFunctionDataTypes from revengai.models.base_response_generation_status_list import BaseResponseGenerationStatusList +from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody +from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody from revengai.models.function_data_types_params import FunctionDataTypesParams -from revengai.models.update_function_data_types import UpdateFunctionDataTypes from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -43,10 +45,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def generate_function_data_types_for_analysis( + def batch_update_function_data_types( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -59,15 +61,15 @@ def generate_function_data_types_for_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGenerateFunctionDataTypes: - """Generate Function Data Types + ) -> BatchUpdateDataTypesOutputBody: + """Batch update function data types - Submits a request to generate the function data types + Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param batch_update_data_types_input_body: (required) + :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -90,9 +92,9 @@ def generate_function_data_types_for_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._batch_update_function_data_types_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + batch_update_data_types_input_body=batch_update_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -100,8 +102,12 @@ def generate_function_data_types_for_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "BatchUpdateDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -115,10 +121,10 @@ def generate_function_data_types_for_analysis( @validate_call - def generate_function_data_types_for_analysis_with_http_info( + def batch_update_function_data_types_with_http_info( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -131,15 +137,15 @@ def generate_function_data_types_for_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseGenerateFunctionDataTypes]: - """Generate Function Data Types + ) -> ApiResponse[BatchUpdateDataTypesOutputBody]: + """Batch update function data types - Submits a request to generate the function data types + Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param batch_update_data_types_input_body: (required) + :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -162,9 +168,9 @@ def generate_function_data_types_for_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._batch_update_function_data_types_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + batch_update_data_types_input_body=batch_update_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -172,8 +178,12 @@ def generate_function_data_types_for_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "BatchUpdateDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -187,10 +197,10 @@ def generate_function_data_types_for_analysis_with_http_info( @validate_call - def generate_function_data_types_for_analysis_without_preload_content( + def batch_update_function_data_types_without_preload_content( self, - analysis_id: StrictInt, - function_data_types_params: FunctionDataTypesParams, + analysis_id: Annotated[int, Field(strict=True, ge=1, description="Analysis ID")], + batch_update_data_types_input_body: BatchUpdateDataTypesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -204,14 +214,14 @@ def generate_function_data_types_for_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Generate Function Data Types + """Batch update function data types - Submits a request to generate the function data types + Updates data types for multiple functions in one analysis. All function IDs in the body must belong to the analysis. Each item is processed independently and reports its own outcome: a stale `data_types_version` yields `version_conflict` for that item without affecting the rest of the batch. **Error codes:** - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `400` [`BAD_REQUEST`](/errors/BAD_REQUEST) — Bad Request - :param analysis_id: (required) + :param analysis_id: Analysis ID (required) :type analysis_id: int - :param function_data_types_params: (required) - :type function_data_types_params: FunctionDataTypesParams + :param batch_update_data_types_input_body: (required) + :type batch_update_data_types_input_body: BatchUpdateDataTypesInputBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -234,9 +244,9 @@ def generate_function_data_types_for_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_analysis_serialize( + _param = self._batch_update_function_data_types_serialize( analysis_id=analysis_id, - function_data_types_params=function_data_types_params, + batch_update_data_types_input_body=batch_update_data_types_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -244,8 +254,12 @@ def generate_function_data_types_for_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerateFunctionDataTypes", - '422': "BaseResponse", + '200': "BatchUpdateDataTypesOutputBody", + '400': "APIError", + '403': "APIError", + '404': "APIError", + '422': "APIError", + '500': "APIError", } response_data = self.api_client.call_api( *_param, @@ -254,10 +268,10 @@ def generate_function_data_types_for_analysis_without_preload_content( return response_data.response - def _generate_function_data_types_for_analysis_serialize( + def _batch_update_function_data_types_serialize( self, analysis_id, - function_data_types_params, + batch_update_data_types_input_body, _request_auth, _content_type, _headers, @@ -285,8 +299,8 @@ def _generate_function_data_types_for_analysis_serialize( # process the header parameters # process the form parameters # process the body parameter - if function_data_types_params is not None: - _body_params = function_data_types_params + if batch_update_data_types_input_body is not None: + _body_params = batch_update_data_types_input_body # set the HTTP header `Accept` @@ -317,8 +331,8 @@ def _generate_function_data_types_for_analysis_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/analyses/{analysis_id}/functions/data_types', + method='PUT', + resource_path='/v3/analyses/{analysis_id}/functions/data-types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -335,8 +349,9 @@ def _generate_function_data_types_for_analysis_serialize( @validate_call - def generate_function_data_types_for_functions( + def generate_function_data_types_for_analysis( self, + analysis_id: StrictInt, function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, @@ -350,11 +365,13 @@ def generate_function_data_types_for_functions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseGenerationStatusList: - """Generate Function Data Types for an arbitrary list of functions + ) -> BaseResponseGenerateFunctionDataTypes: + """Generate Function Data Types Submits a request to generate the function data types + :param analysis_id: (required) + :type analysis_id: int :param function_data_types_params: (required) :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one @@ -379,7 +396,8 @@ def generate_function_data_types_for_functions( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( + _param = self._generate_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, @@ -388,7 +406,7 @@ def generate_function_data_types_for_functions( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", + '201': "BaseResponseGenerateFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -403,8 +421,9 @@ def generate_function_data_types_for_functions( @validate_call - def generate_function_data_types_for_functions_with_http_info( + def generate_function_data_types_for_analysis_with_http_info( self, + analysis_id: StrictInt, function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, @@ -418,11 +437,13 @@ def generate_function_data_types_for_functions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseGenerationStatusList]: - """Generate Function Data Types for an arbitrary list of functions + ) -> ApiResponse[BaseResponseGenerateFunctionDataTypes]: + """Generate Function Data Types Submits a request to generate the function data types + :param analysis_id: (required) + :type analysis_id: int :param function_data_types_params: (required) :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one @@ -447,7 +468,8 @@ def generate_function_data_types_for_functions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( + _param = self._generate_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, @@ -456,7 +478,7 @@ def generate_function_data_types_for_functions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", + '201': "BaseResponseGenerateFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -471,8 +493,9 @@ def generate_function_data_types_for_functions_with_http_info( @validate_call - def generate_function_data_types_for_functions_without_preload_content( + def generate_function_data_types_for_analysis_without_preload_content( self, + analysis_id: StrictInt, function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, @@ -487,10 +510,12 @@ def generate_function_data_types_for_functions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Generate Function Data Types for an arbitrary list of functions + """Generate Function Data Types Submits a request to generate the function data types + :param analysis_id: (required) + :type analysis_id: int :param function_data_types_params: (required) :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one @@ -515,7 +540,8 @@ def generate_function_data_types_for_functions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_function_data_types_for_functions_serialize( + _param = self._generate_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, @@ -524,7 +550,7 @@ def generate_function_data_types_for_functions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "BaseResponseGenerationStatusList", + '201': "BaseResponseGenerateFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -534,8 +560,9 @@ def generate_function_data_types_for_functions_without_preload_content( return response_data.response - def _generate_function_data_types_for_functions_serialize( + def _generate_function_data_types_for_analysis_serialize( self, + analysis_id, function_data_types_params, _request_auth, _content_type, @@ -558,6 +585,8 @@ def _generate_function_data_types_for_functions_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters # process the header parameters # process the form parameters @@ -595,7 +624,7 @@ def _generate_function_data_types_for_functions_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/functions/data_types', + resource_path='/v2/analyses/{analysis_id}/functions/data_types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -612,10 +641,9 @@ def _generate_function_data_types_for_functions_serialize( @validate_call - def get_function_data_types( + def generate_function_data_types_for_functions( self, - analysis_id: StrictInt, - function_id: StrictInt, + function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -628,15 +656,13 @@ def get_function_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionDataTypes: - """Get Function Data Types + ) -> BaseResponseGenerationStatusList: + """Generate Function Data Types for an arbitrary list of functions - Polling endpoint which returns the current status of function generation and once completed the data type information + Submits a request to generate the function data types - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int + :param function_data_types_params: (required) + :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -659,9 +685,8 @@ def get_function_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, + _param = self._generate_function_data_types_for_functions_serialize( + function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -669,7 +694,7 @@ def get_function_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '201': "BaseResponseGenerationStatusList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -684,10 +709,9 @@ def get_function_data_types( @validate_call - def get_function_data_types_with_http_info( + def generate_function_data_types_for_functions_with_http_info( self, - analysis_id: StrictInt, - function_id: StrictInt, + function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -700,15 +724,13 @@ def get_function_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionDataTypes]: - """Get Function Data Types + ) -> ApiResponse[BaseResponseGenerationStatusList]: + """Generate Function Data Types for an arbitrary list of functions - Polling endpoint which returns the current status of function generation and once completed the data type information + Submits a request to generate the function data types - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int + :param function_data_types_params: (required) + :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -731,9 +753,8 @@ def get_function_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, + _param = self._generate_function_data_types_for_functions_serialize( + function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -741,7 +762,7 @@ def get_function_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '201': "BaseResponseGenerationStatusList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -756,10 +777,9 @@ def get_function_data_types_with_http_info( @validate_call - def get_function_data_types_without_preload_content( + def generate_function_data_types_for_functions_without_preload_content( self, - analysis_id: StrictInt, - function_id: StrictInt, + function_data_types_params: FunctionDataTypesParams, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -773,14 +793,12 @@ def get_function_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Function Data Types + """Generate Function Data Types for an arbitrary list of functions - Polling endpoint which returns the current status of function generation and once completed the data type information + Submits a request to generate the function data types - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int + :param function_data_types_params: (required) + :type function_data_types_params: FunctionDataTypesParams :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -803,9 +821,8 @@ def get_function_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, + _param = self._generate_function_data_types_for_functions_serialize( + function_data_types_params=function_data_types_params, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -813,7 +830,7 @@ def get_function_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '201': "BaseResponseGenerationStatusList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -823,10 +840,9 @@ def get_function_data_types_without_preload_content( return response_data.response - def _get_function_data_types_serialize( + def _generate_function_data_types_for_functions_serialize( self, - analysis_id, - function_id, + function_data_types_params, _request_auth, _content_type, _headers, @@ -848,14 +864,12 @@ def _get_function_data_types_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id - if function_id is not None: - _path_params['function_id'] = function_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if function_data_types_params is not None: + _body_params = function_data_types_params # set the HTTP header `Accept` @@ -866,6 +880,19 @@ def _get_function_data_types_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -873,8 +900,8 @@ def _get_function_data_types_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v2/analyses/{analysis_id}/functions/{function_id}/data_types', + method='POST', + resource_path='/v2/functions/data_types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -891,10 +918,10 @@ def _get_function_data_types_serialize( @validate_call - def list_function_data_types_for_analysis( + def get_function_data_types( self, analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -907,15 +934,15 @@ def list_function_data_types_for_analysis( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionDataTypesList: - """List Function Data Types + ) -> BaseResponseFunctionDataTypes: + """Get Function Data Types - Returns data types for multiple functions with optional function ID filtering + Polling endpoint which returns the current status of function generation and once completed the data type information :param analysis_id: (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -938,9 +965,9 @@ def list_function_data_types_for_analysis( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._get_function_data_types_serialize( analysis_id=analysis_id, - function_ids=function_ids, + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -948,7 +975,7 @@ def list_function_data_types_for_analysis( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", + '200': "BaseResponseFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -963,10 +990,10 @@ def list_function_data_types_for_analysis( @validate_call - def list_function_data_types_for_analysis_with_http_info( + def get_function_data_types_with_http_info( self, analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -979,15 +1006,15 @@ def list_function_data_types_for_analysis_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionDataTypesList]: - """List Function Data Types + ) -> ApiResponse[BaseResponseFunctionDataTypes]: + """Get Function Data Types - Returns data types for multiple functions with optional function ID filtering + Polling endpoint which returns the current status of function generation and once completed the data type information :param analysis_id: (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1010,9 +1037,9 @@ def list_function_data_types_for_analysis_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._get_function_data_types_serialize( analysis_id=analysis_id, - function_ids=function_ids, + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1020,7 +1047,7 @@ def list_function_data_types_for_analysis_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", + '200': "BaseResponseFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1035,10 +1062,10 @@ def list_function_data_types_for_analysis_with_http_info( @validate_call - def list_function_data_types_for_analysis_without_preload_content( + def get_function_data_types_without_preload_content( self, analysis_id: StrictInt, - function_ids: Optional[List[Optional[StrictInt]]] = None, + function_id: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1052,14 +1079,14 @@ def list_function_data_types_for_analysis_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Function Data Types + """Get Function Data Types - Returns data types for multiple functions with optional function ID filtering + Polling endpoint which returns the current status of function generation and once completed the data type information :param analysis_id: (required) :type analysis_id: int - :param function_ids: - :type function_ids: List[Optional[int]] + :param function_id: (required) + :type function_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1082,9 +1109,9 @@ def list_function_data_types_for_analysis_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_analysis_serialize( + _param = self._get_function_data_types_serialize( analysis_id=analysis_id, - function_ids=function_ids, + function_id=function_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1092,7 +1119,7 @@ def list_function_data_types_for_analysis_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypesList", + '200': "BaseResponseFunctionDataTypes", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1102,10 +1129,10 @@ def list_function_data_types_for_analysis_without_preload_content( return response_data.response - def _list_function_data_types_for_analysis_serialize( + def _get_function_data_types_serialize( self, analysis_id, - function_ids, + function_id, _request_auth, _content_type, _headers, @@ -1115,7 +1142,6 @@ def _list_function_data_types_for_analysis_serialize( _host = None _collection_formats: Dict[str, str] = { - 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -1130,11 +1156,9 @@ def _list_function_data_types_for_analysis_serialize( # process the path parameters if analysis_id is not None: _path_params['analysis_id'] = analysis_id + if function_id is not None: + _path_params['function_id'] = function_id # process the query parameters - if function_ids is not None: - - _query_params.append(('function_ids', function_ids)) - # process the header parameters # process the form parameters # process the body parameter @@ -1156,7 +1180,7 @@ def _list_function_data_types_for_analysis_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/analyses/{analysis_id}/functions/data_types', + resource_path='/v2/analyses/{analysis_id}/functions/{function_id}/data_types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1173,8 +1197,9 @@ def _list_function_data_types_for_analysis_serialize( @validate_call - def list_function_data_types_for_functions( + def list_function_data_types_for_analysis( self, + analysis_id: StrictInt, function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, @@ -1191,8 +1216,10 @@ def list_function_data_types_for_functions( ) -> BaseResponseFunctionDataTypesList: """List Function Data Types - Returns data types for multiple function IDs + Returns data types for multiple functions with optional function ID filtering + :param analysis_id: (required) + :type analysis_id: int :param function_ids: :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one @@ -1217,7 +1244,8 @@ def list_function_data_types_for_functions( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_functions_serialize( + _param = self._list_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -1241,8 +1269,9 @@ def list_function_data_types_for_functions( @validate_call - def list_function_data_types_for_functions_with_http_info( + def list_function_data_types_for_analysis_with_http_info( self, + analysis_id: StrictInt, function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, @@ -1259,8 +1288,10 @@ def list_function_data_types_for_functions_with_http_info( ) -> ApiResponse[BaseResponseFunctionDataTypesList]: """List Function Data Types - Returns data types for multiple function IDs + Returns data types for multiple functions with optional function ID filtering + :param analysis_id: (required) + :type analysis_id: int :param function_ids: :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one @@ -1285,7 +1316,8 @@ def list_function_data_types_for_functions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_functions_serialize( + _param = self._list_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -1309,8 +1341,9 @@ def list_function_data_types_for_functions_with_http_info( @validate_call - def list_function_data_types_for_functions_without_preload_content( + def list_function_data_types_for_analysis_without_preload_content( self, + analysis_id: StrictInt, function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, @@ -1327,8 +1360,10 @@ def list_function_data_types_for_functions_without_preload_content( ) -> RESTResponseType: """List Function Data Types - Returns data types for multiple function IDs + Returns data types for multiple functions with optional function ID filtering + :param analysis_id: (required) + :type analysis_id: int :param function_ids: :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one @@ -1353,7 +1388,8 @@ def list_function_data_types_for_functions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_function_data_types_for_functions_serialize( + _param = self._list_function_data_types_for_analysis_serialize( + analysis_id=analysis_id, function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, @@ -1372,8 +1408,9 @@ def list_function_data_types_for_functions_without_preload_content( return response_data.response - def _list_function_data_types_for_functions_serialize( + def _list_function_data_types_for_analysis_serialize( self, + analysis_id, function_ids, _request_auth, _content_type, @@ -1397,6 +1434,8 @@ def _list_function_data_types_for_functions_serialize( _body_params: Optional[bytes] = None # process the path parameters + if analysis_id is not None: + _path_params['analysis_id'] = analysis_id # process the query parameters if function_ids is not None: @@ -1423,7 +1462,7 @@ def _list_function_data_types_for_functions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/functions/data_types', + resource_path='/v2/analyses/{analysis_id}/functions/data_types', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1440,11 +1479,9 @@ def _list_function_data_types_for_functions_serialize( @validate_call - def update_function_data_types( + def list_function_data_types_for_functions( self, - analysis_id: StrictInt, - function_id: StrictInt, - update_function_data_types: UpdateFunctionDataTypes, + function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1457,17 +1494,13 @@ def update_function_data_types( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BaseResponseFunctionDataTypes: - """Update Function Data Types + ) -> BaseResponseFunctionDataTypesList: + """List Function Data Types - Updates the function data types for a given function + Returns data types for multiple function IDs - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int - :param update_function_data_types: (required) - :type update_function_data_types: UpdateFunctionDataTypes + :param function_ids: + :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1490,10 +1523,8 @@ def update_function_data_types( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, - update_function_data_types=update_function_data_types, + _param = self._list_function_data_types_for_functions_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1501,7 +1532,7 @@ def update_function_data_types( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '200': "BaseResponseFunctionDataTypesList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1516,11 +1547,9 @@ def update_function_data_types( @validate_call - def update_function_data_types_with_http_info( + def list_function_data_types_for_functions_with_http_info( self, - analysis_id: StrictInt, - function_id: StrictInt, - update_function_data_types: UpdateFunctionDataTypes, + function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1533,17 +1562,13 @@ def update_function_data_types_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BaseResponseFunctionDataTypes]: - """Update Function Data Types + ) -> ApiResponse[BaseResponseFunctionDataTypesList]: + """List Function Data Types - Updates the function data types for a given function + Returns data types for multiple function IDs - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int - :param update_function_data_types: (required) - :type update_function_data_types: UpdateFunctionDataTypes + :param function_ids: + :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1566,10 +1591,8 @@ def update_function_data_types_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, - update_function_data_types=update_function_data_types, + _param = self._list_function_data_types_for_functions_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1577,7 +1600,7 @@ def update_function_data_types_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '200': "BaseResponseFunctionDataTypesList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1592,11 +1615,9 @@ def update_function_data_types_with_http_info( @validate_call - def update_function_data_types_without_preload_content( + def list_function_data_types_for_functions_without_preload_content( self, - analysis_id: StrictInt, - function_id: StrictInt, - update_function_data_types: UpdateFunctionDataTypes, + function_ids: Optional[List[Optional[StrictInt]]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1610,16 +1631,12 @@ def update_function_data_types_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Function Data Types + """List Function Data Types - Updates the function data types for a given function + Returns data types for multiple function IDs - :param analysis_id: (required) - :type analysis_id: int - :param function_id: (required) - :type function_id: int - :param update_function_data_types: (required) - :type update_function_data_types: UpdateFunctionDataTypes + :param function_ids: + :type function_ids: List[Optional[int]] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1642,10 +1659,8 @@ def update_function_data_types_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_function_data_types_serialize( - analysis_id=analysis_id, - function_id=function_id, - update_function_data_types=update_function_data_types, + _param = self._list_function_data_types_for_functions_serialize( + function_ids=function_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1653,7 +1668,7 @@ def update_function_data_types_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BaseResponseFunctionDataTypes", + '200': "BaseResponseFunctionDataTypesList", '422': "BaseResponse", } response_data = self.api_client.call_api( @@ -1663,11 +1678,9 @@ def update_function_data_types_without_preload_content( return response_data.response - def _update_function_data_types_serialize( + def _list_function_data_types_for_functions_serialize( self, - analysis_id, - function_id, - update_function_data_types, + function_ids, _request_auth, _content_type, _headers, @@ -1677,6 +1690,7 @@ def _update_function_data_types_serialize( _host = None _collection_formats: Dict[str, str] = { + 'function_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -1689,16 +1703,14 @@ def _update_function_data_types_serialize( _body_params: Optional[bytes] = None # process the path parameters - if analysis_id is not None: - _path_params['analysis_id'] = analysis_id - if function_id is not None: - _path_params['function_id'] = function_id # process the query parameters + if function_ids is not None: + + _query_params.append(('function_ids', function_ids)) + # process the header parameters # process the form parameters # process the body parameter - if update_function_data_types is not None: - _body_params = update_function_data_types # set the HTTP header `Accept` @@ -1709,19 +1721,6 @@ def _update_function_data_types_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1729,8 +1728,8 @@ def _update_function_data_types_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/analyses/{analysis_id}/functions/{function_id}/data_types', + method='GET', + resource_path='/v2/functions/data_types', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/revengai/api_client.py b/revengai/api_client.py index 379dd83a..1663cc9e 100644 --- a/revengai/api_client.py +++ b/revengai/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v3.94.1/python' + self.user_agent = 'OpenAPI-Generator/v3.95.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index c07c0108..95a9dd11 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -533,8 +533,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v3.94.1\n"\ - "SDK Package Version: v3.94.1".\ + "Version of the API: v3.95.1\n"\ + "SDK Package Version: v3.95.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index 86535ea9..cc76bba9 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -132,6 +132,10 @@ from revengai.models.batch_rename_input_body import BatchRenameInputBody from revengai.models.batch_rename_item import BatchRenameItem from revengai.models.batch_rename_output_body import BatchRenameOutputBody +from revengai.models.batch_update_data_types_input_body import BatchUpdateDataTypesInputBody +from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem +from revengai.models.batch_update_data_types_output_body import BatchUpdateDataTypesOutputBody +from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult from revengai.models.binaries_related_status_response import BinariesRelatedStatusResponse from revengai.models.binaries_task_status import BinariesTaskStatus from revengai.models.binary import Binary @@ -250,9 +254,8 @@ from revengai.models.function_data_types_params import FunctionDataTypesParams from revengai.models.function_data_types_status import FunctionDataTypesStatus from revengai.models.function_header import FunctionHeader -from revengai.models.function_info_input import FunctionInfoInput -from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner -from revengai.models.function_info_output import FunctionInfoOutput +from revengai.models.function_info import FunctionInfo +from revengai.models.function_info_func_deps_inner import FunctionInfoFuncDepsInner from revengai.models.function_list_item import FunctionListItem from revengai.models.function_local_variable_response import FunctionLocalVariableResponse from revengai.models.function_mapping import FunctionMapping @@ -270,8 +273,7 @@ from revengai.models.function_string import FunctionString from revengai.models.function_string_item import FunctionStringItem from revengai.models.function_strings_response import FunctionStringsResponse -from revengai.models.function_type_input import FunctionTypeInput -from revengai.models.function_type_output import FunctionTypeOutput +from revengai.models.function_type import FunctionType from revengai.models.functions_detail_response import FunctionsDetailResponse from revengai.models.functions_list_rename import FunctionsListRename from revengai.models.generate_function_data_types import GenerateFunctionDataTypes @@ -415,7 +417,8 @@ from revengai.models.trigger_dynamic_execution_input_body import TriggerDynamicExecutionInputBody from revengai.models.ttp import Ttp from revengai.models.type_definition import TypeDefinition -from revengai.models.update_function_data_types import UpdateFunctionDataTypes +from revengai.models.update_data_types_input_body import UpdateDataTypesInputBody +from revengai.models.update_data_types_output_body import UpdateDataTypesOutputBody from revengai.models.upload_file_type import UploadFileType from revengai.models.upload_response import UploadResponse from revengai.models.upsert_ai_decomplation_rating_request import UpsertAiDecomplationRatingRequest diff --git a/revengai/models/batch_update_data_types_input_body.py b/revengai/models/batch_update_data_types_input_body.py new file mode 100644 index 00000000..9f447c58 --- /dev/null +++ b/revengai/models/batch_update_data_types_input_body.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from revengai.models.batch_update_data_types_item import BatchUpdateDataTypesItem +from typing import Optional, Set +from typing_extensions import Self + +class BatchUpdateDataTypesInputBody(BaseModel): + """ + BatchUpdateDataTypesInputBody + """ # noqa: E501 + functions: Optional[Annotated[List[BatchUpdateDataTypesItem], Field(min_length=1, max_length=1000)]] = Field(description="List of functions to update. All function IDs must belong to the analysis in the URL.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["functions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesInputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if functions (nullable) is None + # and model_fields_set contains the field + if self.functions is None and "functions" in self.model_fields_set: + _dict['functions'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [BatchUpdateDataTypesItem.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_info_output.py b/revengai/models/batch_update_data_types_item.py similarity index 61% rename from revengai/models/function_info_output.py rename to revengai/models/batch_update_data_types_item.py index d68f25e1..0db860a0 100644 --- a/revengai/models/function_info_output.py +++ b/revengai/models/batch_update_data_types_item.py @@ -18,18 +18,19 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner -from revengai.models.function_type_output import FunctionTypeOutput +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class FunctionInfoOutput(BaseModel): +class BatchUpdateDataTypesItem(BaseModel): """ - FunctionInfoOutput + BatchUpdateDataTypesItem """ # noqa: E501 - func_types: Optional[FunctionTypeOutput] = None - func_deps: List[FunctionInfoInputFuncDepsInner] = Field(description="List of function dependencies") - __properties: ClassVar[List[str]] = ["func_types", "func_deps"] + data_types: Optional[Any] + data_types_version: Annotated[int, Field(strict=True, ge=0)] = Field(description="Current stored version. Pass 0 on the first write.") + function_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Function ID") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "function_id"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionInfoOutput from a JSON string""" + """Create an instance of BatchUpdateDataTypesItem from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,26 +73,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of func_types - if self.func_types: - _dict['func_types'] = self.func_types.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in func_deps (list) - _items = [] - if self.func_deps: - for _item_func_deps in self.func_deps: - if _item_func_deps: - _items.append(_item_func_deps.to_dict()) - _dict['func_deps'] = _items - # set to None if func_types (nullable) is None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None # and model_fields_set contains the field - if self.func_types is None and "func_types" in self.model_fields_set: - _dict['func_types'] = None + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionInfoOutput from a dict""" + """Create an instance of BatchUpdateDataTypesItem from a dict""" if obj is None: return None @@ -97,9 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "func_types": FunctionTypeOutput.from_dict(obj["func_types"]) if obj.get("func_types") is not None else None, - "func_deps": [FunctionInfoInputFuncDepsInner.from_dict(_item) for _item in obj["func_deps"]] if obj.get("func_deps") is not None else None + "data_types": obj.get("data_types"), + "data_types_version": obj.get("data_types_version"), + "function_id": obj.get("function_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/revengai/models/batch_update_data_types_output_body.py b/revengai/models/batch_update_data_types_output_body.py new file mode 100644 index 00000000..f4db7d1b --- /dev/null +++ b/revengai/models/batch_update_data_types_output_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from revengai.models.batch_update_data_types_result import BatchUpdateDataTypesResult +from typing import Optional, Set +from typing_extensions import Self + +class BatchUpdateDataTypesOutputBody(BaseModel): + """ + BatchUpdateDataTypesOutputBody + """ # noqa: E501 + results: Optional[List[BatchUpdateDataTypesResult]] = Field(description="Per-function outcomes in the same order as the input") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesOutputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if results (nullable) is None + # and model_fields_set contains the field + if self.results is None and "results" in self.model_fields_set: + _dict['results'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesOutputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [BatchUpdateDataTypesResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/batch_update_data_types_result.py b/revengai/models/batch_update_data_types_result.py new file mode 100644 index 00000000..6d087595 --- /dev/null +++ b/revengai/models/batch_update_data_types_result.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BatchUpdateDataTypesResult(BaseModel): + """ + BatchUpdateDataTypesResult + """ # noqa: E501 + data_types: Optional[Any] = None + data_types_version: Optional[StrictInt] = Field(default=None, description="Version after update (present when status is 'updated')") + error: Optional[StrictStr] = Field(default=None, description="Error message (present when status is 'error')") + function_id: StrictInt = Field(description="Function ID") + status: StrictStr = Field(description="Outcome for this function") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "error", "function_id", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['updated', 'version_conflict', 'error', 'unknown_default_open_api']): + raise ValueError("must be one of enum values ('updated', 'version_conflict', 'error', 'unknown_default_open_api')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchUpdateDataTypesResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_types": obj.get("data_types"), + "data_types_version": obj.get("data_types_version"), + "error": obj.get("error"), + "function_id": obj.get("function_id"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/function_data_types.py b/revengai/models/function_data_types.py index f3150753..2367bad1 100644 --- a/revengai/models/function_data_types.py +++ b/revengai/models/function_data_types.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_info_output import FunctionInfoOutput +from revengai.models.function_info import FunctionInfo from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class FunctionDataTypes(BaseModel): """ # noqa: E501 completed: StrictBool = Field(description="Whether the service has completed data types generation") status: StrictStr = Field(description="The current status of the data types service") - data_types: Optional[FunctionInfoOutput] = None + data_types: Optional[FunctionInfo] = None data_types_version: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["completed", "status", "data_types", "data_types_version"] @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "completed": obj.get("completed"), "status": obj.get("status"), - "data_types": FunctionInfoOutput.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, + "data_types": FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, "data_types_version": obj.get("data_types_version") }) return _obj diff --git a/revengai/models/function_data_types_list_item.py b/revengai/models/function_data_types_list_item.py index b9e40ab1..7f0772dd 100644 --- a/revengai/models/function_data_types_list_item.py +++ b/revengai/models/function_data_types_list_item.py @@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_info_output import FunctionInfoOutput +from revengai.models.function_info import FunctionInfo from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class FunctionDataTypesListItem(BaseModel): """ # noqa: E501 completed: StrictBool = Field(description="Whether the service has completed data types generation") status: StrictStr = Field(description="The current status of the data types service") - data_types: Optional[FunctionInfoOutput] = None + data_types: Optional[FunctionInfo] = None data_types_version: Optional[StrictInt] = None function_id: StrictInt = Field(description="Function id") __properties: ClassVar[List[str]] = ["completed", "status", "data_types", "data_types_version", "function_id"] @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "completed": obj.get("completed"), "status": obj.get("status"), - "data_types": FunctionInfoOutput.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, + "data_types": FunctionInfo.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None, "data_types_version": obj.get("data_types_version"), "function_id": obj.get("function_id") }) diff --git a/revengai/models/function_info_input.py b/revengai/models/function_info.py similarity index 80% rename from revengai/models/function_info_input.py rename to revengai/models/function_info.py index cff53c72..a76fa407 100644 --- a/revengai/models/function_info_input.py +++ b/revengai/models/function_info.py @@ -18,17 +18,17 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_info_input_func_deps_inner import FunctionInfoInputFuncDepsInner -from revengai.models.function_type_input import FunctionTypeInput +from revengai.models.function_info_func_deps_inner import FunctionInfoFuncDepsInner +from revengai.models.function_type import FunctionType from typing import Optional, Set from typing_extensions import Self -class FunctionInfoInput(BaseModel): +class FunctionInfo(BaseModel): """ - FunctionInfoInput + FunctionInfo """ # noqa: E501 - func_types: Optional[FunctionTypeInput] = None - func_deps: List[FunctionInfoInputFuncDepsInner] = Field(description="List of function dependencies") + func_types: Optional[FunctionType] = None + func_deps: List[FunctionInfoFuncDepsInner] = Field(description="List of function dependencies") __properties: ClassVar[List[str]] = ["func_types", "func_deps"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionInfoInput from a JSON string""" + """Create an instance of FunctionInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -89,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionInfoInput from a dict""" + """Create an instance of FunctionInfo from a dict""" if obj is None: return None @@ -97,8 +97,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "func_types": FunctionTypeInput.from_dict(obj["func_types"]) if obj.get("func_types") is not None else None, - "func_deps": [FunctionInfoInputFuncDepsInner.from_dict(_item) for _item in obj["func_deps"]] if obj.get("func_deps") is not None else None + "func_types": FunctionType.from_dict(obj["func_types"]) if obj.get("func_types") is not None else None, + "func_deps": [FunctionInfoFuncDepsInner.from_dict(_item) for _item in obj["func_deps"]] if obj.get("func_deps") is not None else None }) return _obj diff --git a/revengai/models/function_info_input_func_deps_inner.py b/revengai/models/function_info_func_deps_inner.py similarity index 90% rename from revengai/models/function_info_input_func_deps_inner.py rename to revengai/models/function_info_func_deps_inner.py index 23e3f52b..32478f3b 100644 --- a/revengai/models/function_info_input_func_deps_inner.py +++ b/revengai/models/function_info_func_deps_inner.py @@ -26,11 +26,11 @@ from typing_extensions import Literal, Self from pydantic import Field -FUNCTIONINFOINPUTFUNCDEPSINNER_ANY_OF_SCHEMAS = ["Enumeration", "GlobalVariable", "Structure", "TypeDefinition"] +FUNCTIONINFOFUNCDEPSINNER_ANY_OF_SCHEMAS = ["Enumeration", "GlobalVariable", "Structure", "TypeDefinition"] -class FunctionInfoInputFuncDepsInner(BaseModel): +class FunctionInfoFuncDepsInner(BaseModel): """ - FunctionInfoInputFuncDepsInner + FunctionInfoFuncDepsInner """ # data type: Structure @@ -64,7 +64,7 @@ def __init__(self, *args, **kwargs) -> None: @field_validator('actual_instance') def actual_instance_must_validate_anyof(cls, v): - instance = FunctionInfoInputFuncDepsInner.model_construct() + instance = FunctionInfoFuncDepsInner.model_construct() error_messages = [] # validate data type: Structure if not isinstance(v, Structure): @@ -92,7 +92,7 @@ def actual_instance_must_validate_anyof(cls, v): if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in FunctionInfoInputFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in FunctionInfoFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. Details: " + ", ".join(error_messages)) else: return v @@ -132,7 +132,7 @@ def from_json(cls, json_str: str) -> Self: if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into FunctionInfoInputFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into FunctionInfoFuncDepsInner with anyOf schemas: Enumeration, GlobalVariable, Structure, TypeDefinition. Details: " + ", ".join(error_messages)) else: return instance diff --git a/revengai/models/function_type_input.py b/revengai/models/function_type.py similarity index 96% rename from revengai/models/function_type_input.py rename to revengai/models/function_type.py index c09a4c88..5554e58f 100644 --- a/revengai/models/function_type_input.py +++ b/revengai/models/function_type.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class FunctionTypeInput(BaseModel): +class FunctionType(BaseModel): """ - FunctionTypeInput + FunctionType """ # noqa: E501 last_change: Optional[StrictStr] = None addr: StrictInt = Field(description="Memory address of the function") @@ -55,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionTypeInput from a JSON string""" + """Create an instance of FunctionType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -100,7 +100,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionTypeInput from a dict""" + """Create an instance of FunctionType from a dict""" if obj is None: return None diff --git a/revengai/models/function_type_output.py b/revengai/models/function_type_output.py deleted file mode 100644 index f32cc35a..00000000 --- a/revengai/models/function_type_output.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - RevEng.AI API - - RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. - - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from revengai.models.function_header import FunctionHeader -from revengai.models.stack_variable import StackVariable -from typing import Optional, Set -from typing_extensions import Self - -class FunctionTypeOutput(BaseModel): - """ - FunctionTypeOutput - """ # noqa: E501 - last_change: Optional[StrictStr] = None - addr: StrictInt = Field(description="Memory address of the function") - size: StrictInt = Field(description="Size of the function in bytes") - header: FunctionHeader = Field(description="Function header information") - stack_vars: Optional[Dict[str, StackVariable]] = None - name: StrictStr = Field(description="Name of the function") - type: StrictStr = Field(description="Return type of the function") - artifact_type: Optional[StrictStr] = Field(default='Function', description="Type of artifact that the structure is associated with") - __properties: ClassVar[List[str]] = ["last_change", "addr", "size", "header", "stack_vars", "name", "type", "artifact_type"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FunctionTypeOutput from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of header - if self.header: - _dict['header'] = self.header.to_dict() - # override the default output from pydantic by calling `to_dict()` of each value in stack_vars (dict) - _field_dict = {} - if self.stack_vars: - for _key_stack_vars in self.stack_vars: - if self.stack_vars[_key_stack_vars]: - _field_dict[_key_stack_vars] = self.stack_vars[_key_stack_vars].to_dict() - _dict['stack_vars'] = _field_dict - # set to None if last_change (nullable) is None - # and model_fields_set contains the field - if self.last_change is None and "last_change" in self.model_fields_set: - _dict['last_change'] = None - - # set to None if stack_vars (nullable) is None - # and model_fields_set contains the field - if self.stack_vars is None and "stack_vars" in self.model_fields_set: - _dict['stack_vars'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FunctionTypeOutput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "last_change": obj.get("last_change"), - "addr": obj.get("addr"), - "size": obj.get("size"), - "header": FunctionHeader.from_dict(obj["header"]) if obj.get("header") is not None else None, - "stack_vars": dict( - (_k, StackVariable.from_dict(_v)) - for _k, _v in obj["stack_vars"].items() - ) - if obj.get("stack_vars") is not None - else None, - "name": obj.get("name"), - "type": obj.get("type"), - "artifact_type": obj.get("artifact_type") if obj.get("artifact_type") is not None else 'Function' - }) - return _obj - - diff --git a/revengai/models/update_data_types_input_body.py b/revengai/models/update_data_types_input_body.py new file mode 100644 index 00000000..c7f35a5c --- /dev/null +++ b/revengai/models/update_data_types_input_body.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + RevEng.AI API + + RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UpdateDataTypesInputBody(BaseModel): + """ + UpdateDataTypesInputBody + """ # noqa: E501 + data_types: Optional[Any] + data_types_version: Annotated[int, Field(strict=True, ge=0)] = Field(description="Current version of the function data types. The update is rejected if the stored version has moved on. Pass 0 on the first write.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "data_types_version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateDataTypesInputBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateDataTypesInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_types": obj.get("data_types"), + "data_types_version": obj.get("data_types_version") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/revengai/models/update_function_data_types.py b/revengai/models/update_data_types_output_body.py similarity index 62% rename from revengai/models/update_function_data_types.py rename to revengai/models/update_data_types_output_body.py index 0984093a..0d75f614 100644 --- a/revengai/models/update_function_data_types.py +++ b/revengai/models/update_data_types_output_body.py @@ -17,18 +17,19 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from revengai.models.function_info_input import FunctionInfoInput +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class UpdateFunctionDataTypes(BaseModel): +class UpdateDataTypesOutputBody(BaseModel): """ - UpdateFunctionDataTypes + UpdateDataTypesOutputBody """ # noqa: E501 - data_types_version: StrictInt = Field(description="Version of the function data types, used to check this update is not overwriting a newer one") - data_types: FunctionInfoInput = Field(description="Function data types information to update") - __properties: ClassVar[List[str]] = ["data_types_version", "data_types"] + data_types: Optional[Any] + data_types_version: StrictInt = Field(description="Version of the stored function data types after the update") + function_id: StrictInt = Field(description="Function ID") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data_types", "data_types_version", "function_id"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateFunctionDataTypes from a JSON string""" + """Create an instance of UpdateDataTypesOutputBody from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,14 +72,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of data_types - if self.data_types: - _dict['data_types'] = self.data_types.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data_types (nullable) is None + # and model_fields_set contains the field + if self.data_types is None and "data_types" in self.model_fields_set: + _dict['data_types'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateFunctionDataTypes from a dict""" + """Create an instance of UpdateDataTypesOutputBody from a dict""" if obj is None: return None @@ -84,9 +94,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "data_types": obj.get("data_types"), "data_types_version": obj.get("data_types_version"), - "data_types": FunctionInfoInput.from_dict(obj["data_types"]) if obj.get("data_types") is not None else None + "function_id": obj.get("function_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj