From a20a879b316830e5f9c13d011b5d457845a13c76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jun 2026 08:22:58 +0000 Subject: [PATCH] Update SDK to version v3.96.3 - Generated from OpenAPI spec version v3.96.3 - Auto-generated by GitHub Actions --- README.md | 2 + docs/IAMUsersApi.md | 77 ++++++++++ docs/Permissions.md | 33 +++++ revengai/__init__.py | 2 + revengai/api/iam_users_api.py | 247 +++++++++++++++++++++++++++++++++ revengai/models/__init__.py | 1 + revengai/models/permissions.py | 107 ++++++++++++++ 7 files changed, 469 insertions(+) create mode 100644 docs/Permissions.md create mode 100644 revengai/models/permissions.py diff --git a/README.md b/README.md index bb208e6..d605fda 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ Class | Method | HTTP request | Description *FunctionsRenamingHistoryApi* | [**revert_function_name**](docs/FunctionsRenamingHistoryApi.md#revert_function_name) | **POST** /v2/functions/history/{function_id}/{history_id} | Revert the function name *FunctionsRenamingHistoryApi* | [**revert_function_name_0**](docs/FunctionsRenamingHistoryApi.md#revert_function_name_0) | **POST** /v3/functions/{function_id}/history/{history_id}/revert | Revert function name *IAMUsersApi* | [**get_me**](docs/IAMUsersApi.md#get_me) | **GET** /v2/iam/me | Get current user +*IAMUsersApi* | [**get_my_permissions**](docs/IAMUsersApi.md#get_my_permissions) | **GET** /v2/iam/me/permissions | Get current user permissions *ModelsApi* | [**get_models**](docs/ModelsApi.md#get_models) | **GET** /v2/models | Gets models *ReportsApi* | [**create_pdf_report**](docs/ReportsApi.md#create_pdf_report) | **POST** /v3/analyses/{analysis_id}/pdf | Start PDF report generation *ReportsApi* | [**download_pdf_report**](docs/ReportsApi.md#download_pdf_report) | **GET** /v3/analyses/{analysis_id}/pdf | Download generated PDF report @@ -558,6 +559,7 @@ Class | Method | HTTP request | Description - [PatchCollectionTagsOutputBody](docs/PatchCollectionTagsOutputBody.md) - [PatchCommentBody](docs/PatchCommentBody.md) - [PcapBodyInfo](docs/PcapBodyInfo.md) + - [Permissions](docs/Permissions.md) - [Platform](docs/Platform.md) - [PriceOutput](docs/PriceOutput.md) - [PriceSummary](docs/PriceSummary.md) diff --git a/docs/IAMUsersApi.md b/docs/IAMUsersApi.md index 9abb4fb..474ba92 100644 --- a/docs/IAMUsersApi.md +++ b/docs/IAMUsersApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.reveng.ai* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_me**](IAMUsersApi.md#get_me) | **GET** /v2/iam/me | Get current user +[**get_my_permissions**](IAMUsersApi.md#get_my_permissions) | **GET** /v2/iam/me/permissions | Get current user permissions # **get_me** @@ -87,3 +88,79 @@ This endpoint does not need any parameter. [[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_my_permissions** +> Permissions get_my_permissions() + +Get current user permissions + +Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + +### Example + +* Api Key Authentication (APIKey): + +```python +import revengai +from revengai.models.permissions import Permissions +from revengai.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.reveng.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = revengai.Configuration( + host = "https://api.reveng.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: APIKey +configuration.api_key['APIKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['APIKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with revengai.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = revengai.IAMUsersApi(api_client) + + try: + # Get current user permissions + api_response = api_instance.get_my_permissions() + print("The response of IAMUsersApi->get_my_permissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IAMUsersApi->get_my_permissions: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Permissions**](Permissions.md) + +### Authorization + +[APIKey](../README.md#APIKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**0** | 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) + diff --git a/docs/Permissions.md b/docs/Permissions.md new file mode 100644 index 0000000..ddd7f47 --- /dev/null +++ b/docs/Permissions.md @@ -0,0 +1,33 @@ +# Permissions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_export_symbols** | **bool** | | +**can_generate_pdf_reports** | **bool** | | +**can_use_ai_malware_analysis** | **bool** | | +**can_use_malware_sandbox** | **bool** | | +**can_use_private_analyses** | **bool** | | + +## Example + +```python +from revengai.models.permissions import Permissions + +# TODO update the JSON string below +json = "{}" +# create an instance of Permissions from a JSON string +permissions_instance = Permissions.from_json(json) +# print the JSON string representation of the object +print(Permissions.to_json()) + +# convert the object into a dict +permissions_dict = permissions_instance.to_dict() +# create an instance of Permissions from a dict +permissions_from_dict = Permissions.from_dict(permissions_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 a6d5d01..0906cb7 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -405,6 +405,7 @@ "PatchCollectionTagsOutputBody", "PatchCommentBody", "PcapBodyInfo", + "Permissions", "Platform", "PriceOutput", "PriceSummary", @@ -932,6 +933,7 @@ from revengai.models.patch_collection_tags_output_body import PatchCollectionTagsOutputBody as PatchCollectionTagsOutputBody from revengai.models.patch_comment_body import PatchCommentBody as PatchCommentBody from revengai.models.pcap_body_info import PcapBodyInfo as PcapBodyInfo +from revengai.models.permissions import Permissions as Permissions from revengai.models.platform import Platform as Platform from revengai.models.price_output import PriceOutput as PriceOutput from revengai.models.price_summary import PriceSummary as PriceSummary diff --git a/revengai/api/iam_users_api.py b/revengai/api/iam_users_api.py index 36f6235..6e5ca7d 100644 --- a/revengai/api/iam_users_api.py +++ b/revengai/api/iam_users_api.py @@ -15,6 +15,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from revengai.models.permissions import Permissions from revengai.models.user import User from revengai.api_client import ApiClient, RequestSerialized @@ -285,3 +286,249 @@ def _get_me_serialize( ) + + + @validate_call + def get_my_permissions( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Permissions: + """Get current user permissions + + Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_my_permissions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_my_permissions_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Permissions]: + """Get current user permissions + + Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_my_permissions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_my_permissions_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get current user permissions + + Returns the feature permissions granted to the authenticated user based on their subscription tier. Use this as the single source of truth for feature gating across web, CLI, and plugin clients. + + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_my_permissions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_my_permissions_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'APIKey' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/iam/me/permissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/revengai/models/__init__.py b/revengai/models/__init__.py index cf9ac70..542582b 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -370,6 +370,7 @@ from revengai.models.patch_collection_tags_output_body import PatchCollectionTagsOutputBody from revengai.models.patch_comment_body import PatchCommentBody from revengai.models.pcap_body_info import PcapBodyInfo +from revengai.models.permissions import Permissions from revengai.models.platform import Platform from revengai.models.price_output import PriceOutput from revengai.models.price_summary import PriceSummary diff --git a/revengai/models/permissions.py b/revengai/models/permissions.py new file mode 100644 index 0000000..85b0824 --- /dev/null +++ b/revengai/models/permissions.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, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Permissions(BaseModel): + """ + Permissions + """ # noqa: E501 + can_export_symbols: StrictBool + can_generate_pdf_reports: StrictBool + can_use_ai_malware_analysis: StrictBool + can_use_malware_sandbox: StrictBool + can_use_private_analyses: StrictBool + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["can_export_symbols", "can_generate_pdf_reports", "can_use_ai_malware_analysis", "can_use_malware_sandbox", "can_use_private_analyses"] + + 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 Permissions 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Permissions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_export_symbols": obj.get("can_export_symbols"), + "can_generate_pdf_reports": obj.get("can_generate_pdf_reports"), + "can_use_ai_malware_analysis": obj.get("can_use_ai_malware_analysis"), + "can_use_malware_sandbox": obj.get("can_use_malware_sandbox"), + "can_use_private_analyses": obj.get("can_use_private_analyses") + }) + # 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 + +