diff --git a/.sdk-version b/.sdk-version index 3a1a0ae8..53eeb925 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.124.0 +v3.129.1 diff --git a/README.md b/README.md index d1da37a4..b51aae27 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**update_collection**](docs/CollectionsApi.md#update_collection) | **PATCH** /v2/collections/{collection_id} | Updates a collection *CollectionsApi* | [**update_collection_binaries**](docs/CollectionsApi.md#update_collection_binaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries *CollectionsApi* | [**update_collection_tags**](docs/CollectionsApi.md#update_collection_tags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags +*CollectionsApi* | [**v3_add_collection_binaries**](docs/CollectionsApi.md#v3_add_collection_binaries) | **POST** /v3/collections/{collection_id}/binaries | Add binaries to a collection. *CollectionsApi* | [**v3_create_collection**](docs/CollectionsApi.md#v3_create_collection) | **POST** /v3/collections | Create a collection. *CollectionsApi* | [**v3_delete_collection**](docs/CollectionsApi.md#v3_delete_collection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. *CollectionsApi* | [**v3_get_collection**](docs/CollectionsApi.md#v3_get_collection) | **GET** /v3/collections/{collection_id} | Get a collection. @@ -118,6 +119,7 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**v3_patch_collection**](docs/CollectionsApi.md#v3_patch_collection) | **PATCH** /v3/collections/{collection_id} | Update a collection. *CollectionsApi* | [**v3_patch_collection_binaries**](docs/CollectionsApi.md#v3_patch_collection_binaries) | **PATCH** /v3/collections/{collection_id}/binaries | Replace the binaries in a collection. *CollectionsApi* | [**v3_patch_collection_tags**](docs/CollectionsApi.md#v3_patch_collection_tags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. +*CollectionsApi* | [**v3_remove_collection_binaries**](docs/CollectionsApi.md#v3_remove_collection_binaries) | **DELETE** /v3/collections/{collection_id}/binaries | Remove binaries from a collection. *ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /v2/config | Get Config *ConversationsApi* | [**cancel_run**](docs/ConversationsApi.md#cancel_run) | **POST** /v2/conversations/{id}/cancel | Cancel an active run *ConversationsApi* | [**confirm_tool**](docs/ConversationsApi.md#confirm_tool) | **POST** /v2/conversations/{id}/confirm | Approve or reject a pending tool confirmation @@ -207,6 +209,7 @@ Class | Method | HTTP request | Description - [AIDecompInverseStringMapItem](docs/AIDecompInverseStringMapItem.md) - [APIError](docs/APIError.md) - [AddCalleeInputBody](docs/AddCalleeInputBody.md) + - [AddCollectionBinariesInputBody](docs/AddCollectionBinariesInputBody.md) - [AddIssuerDomainInputBody](docs/AddIssuerDomainInputBody.md) - [AddOwnerInputBody](docs/AddOwnerInputBody.md) - [AddTeamMemberInputBody](docs/AddTeamMemberInputBody.md) @@ -591,6 +594,7 @@ Class | Method | HTTP request | Description - [RegisterUserInputBody](docs/RegisterUserInputBody.md) - [RegistryOperation](docs/RegistryOperation.md) - [RelativeBinaryResponse](docs/RelativeBinaryResponse.md) + - [RemoveCollectionBinariesInputBody](docs/RemoveCollectionBinariesInputBody.md) - [RenameAppliedEvent](docs/RenameAppliedEvent.md) - [RenameInputBody](docs/RenameInputBody.md) - [RenameOutputBody](docs/RenameOutputBody.md) diff --git a/docs/AddCollectionBinariesInputBody.md b/docs/AddCollectionBinariesInputBody.md new file mode 100644 index 00000000..a776407c --- /dev/null +++ b/docs/AddCollectionBinariesInputBody.md @@ -0,0 +1,29 @@ +# AddCollectionBinariesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binaries** | **List[int]** | Binary IDs to add to the collection. Binary IDs already linked to the collection are ignored. | + +## Example + +```python +from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AddCollectionBinariesInputBody from a JSON string +add_collection_binaries_input_body_instance = AddCollectionBinariesInputBody.from_json(json) +# print the JSON string representation of the object +print(AddCollectionBinariesInputBody.to_json()) + +# convert the object into a dict +add_collection_binaries_input_body_dict = add_collection_binaries_input_body_instance.to_dict() +# create an instance of AddCollectionBinariesInputBody from a dict +add_collection_binaries_input_body_from_dict = AddCollectionBinariesInputBody.from_dict(add_collection_binaries_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/CollectionsApi.md b/docs/CollectionsApi.md index f1fa40a0..88af5999 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**update_collection**](CollectionsApi.md#update_collection) | **PATCH** /v2/collections/{collection_id} | Updates a collection [**update_collection_binaries**](CollectionsApi.md#update_collection_binaries) | **PATCH** /v2/collections/{collection_id}/binaries | Updates a collection binaries [**update_collection_tags**](CollectionsApi.md#update_collection_tags) | **PATCH** /v2/collections/{collection_id}/tags | Updates a collection tags +[**v3_add_collection_binaries**](CollectionsApi.md#v3_add_collection_binaries) | **POST** /v3/collections/{collection_id}/binaries | Add binaries to a collection. [**v3_create_collection**](CollectionsApi.md#v3_create_collection) | **POST** /v3/collections | Create a collection. [**v3_delete_collection**](CollectionsApi.md#v3_delete_collection) | **DELETE** /v3/collections/{collection_id} | Delete a collection. [**v3_get_collection**](CollectionsApi.md#v3_get_collection) | **GET** /v3/collections/{collection_id} | Get a collection. @@ -18,6 +19,7 @@ Method | HTTP request | Description [**v3_patch_collection**](CollectionsApi.md#v3_patch_collection) | **PATCH** /v3/collections/{collection_id} | Update a collection. [**v3_patch_collection_binaries**](CollectionsApi.md#v3_patch_collection_binaries) | **PATCH** /v3/collections/{collection_id}/binaries | Replace the binaries in a collection. [**v3_patch_collection_tags**](CollectionsApi.md#v3_patch_collection_tags) | **PATCH** /v3/collections/{collection_id}/tags | Replace the tags on a collection. +[**v3_remove_collection_binaries**](CollectionsApi.md#v3_remove_collection_binaries) | **DELETE** /v3/collections/{collection_id}/binaries | Remove binaries from a collection. # **create_collection** @@ -655,6 +657,100 @@ 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) +# **v3_add_collection_binaries** +> v3_add_collection_binaries(collection_id, add_collection_binaries_input_body) + +Add binaries to a collection. + +Links the supplied binaries to a collection without affecting any binaries already linked. Binary IDs already linked to the collection are ignored. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied +- `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.CollectionsApi(api_client) + collection_id = 56 # int | + add_collection_binaries_input_body = revengai.AddCollectionBinariesInputBody() # AddCollectionBinariesInputBody | + + try: + # Add binaries to a collection. + api_instance.v3_add_collection_binaries(collection_id, add_collection_binaries_input_body) + except Exception as e: + print("Exception when calling CollectionsApi->v3_add_collection_binaries: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collection_id** | **int**| | + **add_collection_binaries_input_body** | [**AddCollectionBinariesInputBody**](AddCollectionBinariesInputBody.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**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) + # **v3_create_collection** > CreateCollectionOutputBody v3_create_collection(create_collection_input_body) @@ -1331,3 +1427,96 @@ 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) +# **v3_remove_collection_binaries** +> v3_remove_collection_binaries(collection_id, remove_collection_binaries_input_body) + +Remove binaries from a collection. + +Unlinks the supplied binaries from a collection without affecting any other binaries linked to it. Binary IDs not linked to the collection are ignored. + +**Error codes:** +- `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found +- `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + +### Example + +* Api Key Authentication (APIKey): +* Bearer Authentication (bearerAuth): + +```python +import revengai +from revengai.models.remove_collection_binaries_input_body import RemoveCollectionBinariesInputBody +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' + +# Configure Bearer authorization: bearerAuth +configuration = revengai.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.CollectionsApi(api_client) + collection_id = 56 # int | + remove_collection_binaries_input_body = revengai.RemoveCollectionBinariesInputBody() # RemoveCollectionBinariesInputBody | + + try: + # Remove binaries from a collection. + api_instance.v3_remove_collection_binaries(collection_id, remove_collection_binaries_input_body) + except Exception as e: + print("Exception when calling CollectionsApi->v3_remove_collection_binaries: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collection_id** | **int**| | + **remove_collection_binaries_input_body** | [**RemoveCollectionBinariesInputBody**](RemoveCollectionBinariesInputBody.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[APIKey](../README.md#APIKey), [bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**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) + diff --git a/docs/ProductOutput.md b/docs/ProductOutput.md index 67440d33..50903414 100644 --- a/docs/ProductOutput.md +++ b/docs/ProductOutput.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **id** | **str** | Product ID. | **name** | **str** | Human-readable product name. | **prices** | [**List[PriceOutput]**](PriceOutput.md) | All active recurring prices for this product. | +**sales_only** | **bool** | When true, this product is not self-serve purchasable and must be bought via direct sales. | **tier** | **str** | User tier associated with this product, if any. | [optional] ## Example diff --git a/docs/RemoveCollectionBinariesInputBody.md b/docs/RemoveCollectionBinariesInputBody.md new file mode 100644 index 00000000..259becef --- /dev/null +++ b/docs/RemoveCollectionBinariesInputBody.md @@ -0,0 +1,29 @@ +# RemoveCollectionBinariesInputBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binaries** | **List[int]** | Binary IDs to remove from the collection. Binary IDs not linked to the collection are ignored. | + +## Example + +```python +from revengai.models.remove_collection_binaries_input_body import RemoveCollectionBinariesInputBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RemoveCollectionBinariesInputBody from a JSON string +remove_collection_binaries_input_body_instance = RemoveCollectionBinariesInputBody.from_json(json) +# print the JSON string representation of the object +print(RemoveCollectionBinariesInputBody.to_json()) + +# convert the object into a dict +remove_collection_binaries_input_body_dict = remove_collection_binaries_input_body_instance.to_dict() +# create an instance of RemoveCollectionBinariesInputBody from a dict +remove_collection_binaries_input_body_from_dict = RemoveCollectionBinariesInputBody.from_dict(remove_collection_binaries_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/revengai/__init__.py b/revengai/__init__.py index 27e65f81..d9a39c3d 100644 --- a/revengai/__init__.py +++ b/revengai/__init__.py @@ -13,7 +13,7 @@ """ # noqa: E501 -__version__ = "v3.124.0" +__version__ = "v3.129.1" # Define package exports __all__ = [ @@ -52,6 +52,7 @@ "AIDecompInverseStringMapItem", "APIError", "AddCalleeInputBody", + "AddCollectionBinariesInputBody", "AddIssuerDomainInputBody", "AddOwnerInputBody", "AddTeamMemberInputBody", @@ -436,6 +437,7 @@ "RegisterUserInputBody", "RegistryOperation", "RelativeBinaryResponse", + "RemoveCollectionBinariesInputBody", "RenameAppliedEvent", "RenameInputBody", "RenameOutputBody", @@ -595,6 +597,7 @@ from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem as AIDecompInverseStringMapItem from revengai.models.api_error import APIError as APIError from revengai.models.add_callee_input_body import AddCalleeInputBody as AddCalleeInputBody +from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody as AddCollectionBinariesInputBody from revengai.models.add_issuer_domain_input_body import AddIssuerDomainInputBody as AddIssuerDomainInputBody from revengai.models.add_owner_input_body import AddOwnerInputBody as AddOwnerInputBody from revengai.models.add_team_member_input_body import AddTeamMemberInputBody as AddTeamMemberInputBody @@ -979,6 +982,7 @@ from revengai.models.register_user_input_body import RegisterUserInputBody as RegisterUserInputBody from revengai.models.registry_operation import RegistryOperation as RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse as RelativeBinaryResponse +from revengai.models.remove_collection_binaries_input_body import RemoveCollectionBinariesInputBody as RemoveCollectionBinariesInputBody from revengai.models.rename_applied_event import RenameAppliedEvent as RenameAppliedEvent from revengai.models.rename_input_body import RenameInputBody as RenameInputBody from revengai.models.rename_output_body import RenameOutputBody as RenameOutputBody diff --git a/revengai/api/collections_api.py b/revengai/api/collections_api.py index 76075ef2..6c469603 100644 --- a/revengai/api/collections_api.py +++ b/revengai/api/collections_api.py @@ -18,6 +18,7 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated +from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody from revengai.models.app_api_rest_v2_collections_enums_order_by import AppApiRestV2CollectionsEnumsOrderBy from revengai.models.base_response_bool import BaseResponseBool from revengai.models.base_response_collection_binaries_update_response import BaseResponseCollectionBinariesUpdateResponse @@ -40,6 +41,7 @@ from revengai.models.patch_collection_output_body import PatchCollectionOutputBody from revengai.models.patch_collection_tags_input_body import PatchCollectionTagsInputBody from revengai.models.patch_collection_tags_output_body import PatchCollectionTagsOutputBody +from revengai.models.remove_collection_binaries_input_body import RemoveCollectionBinariesInputBody from revengai.api_client import ApiClient, RequestSerialized from revengai.api_response import ApiResponse @@ -2206,9 +2208,10 @@ def _update_collection_tags_serialize( @validate_call - def v3_create_collection( + def v3_add_collection_binaries( self, - create_collection_input_body: CreateCollectionInputBody, + collection_id: Annotated[int, Field(strict=True, ge=1)], + add_collection_binaries_input_body: AddCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2221,13 +2224,15 @@ def v3_create_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateCollectionOutputBody: - """Create a collection. + ) -> None: + """Add binaries to a collection. - Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Links the supplied binaries to a collection without affecting any binaries already linked. Binary IDs already linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param create_collection_input_body: (required) - :type create_collection_input_body: CreateCollectionInputBody + :param collection_id: (required) + :type collection_id: int + :param add_collection_binaries_input_body: (required) + :type add_collection_binaries_input_body: AddCollectionBinariesInputBody :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 @@ -2250,8 +2255,9 @@ def v3_create_collection( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_create_collection_serialize( - create_collection_input_body=create_collection_input_body, + _param = self._v3_add_collection_binaries_serialize( + collection_id=collection_id, + add_collection_binaries_input_body=add_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2259,7 +2265,8 @@ def v3_create_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", '422': "APIError", '500': "APIError", @@ -2276,9 +2283,10 @@ def v3_create_collection( @validate_call - def v3_create_collection_with_http_info( + def v3_add_collection_binaries_with_http_info( self, - create_collection_input_body: CreateCollectionInputBody, + collection_id: Annotated[int, Field(strict=True, ge=1)], + add_collection_binaries_input_body: AddCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2291,13 +2299,15 @@ def v3_create_collection_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[CreateCollectionOutputBody]: - """Create a collection. + ) -> ApiResponse[None]: + """Add binaries to a collection. - Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Links the supplied binaries to a collection without affecting any binaries already linked. Binary IDs already linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param create_collection_input_body: (required) - :type create_collection_input_body: CreateCollectionInputBody + :param collection_id: (required) + :type collection_id: int + :param add_collection_binaries_input_body: (required) + :type add_collection_binaries_input_body: AddCollectionBinariesInputBody :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 @@ -2320,8 +2330,9 @@ def v3_create_collection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_create_collection_serialize( - create_collection_input_body=create_collection_input_body, + _param = self._v3_add_collection_binaries_serialize( + collection_id=collection_id, + add_collection_binaries_input_body=add_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2329,7 +2340,8 @@ def v3_create_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", '422': "APIError", '500': "APIError", @@ -2346,9 +2358,10 @@ def v3_create_collection_with_http_info( @validate_call - def v3_create_collection_without_preload_content( + def v3_add_collection_binaries_without_preload_content( self, - create_collection_input_body: CreateCollectionInputBody, + collection_id: Annotated[int, Field(strict=True, ge=1)], + add_collection_binaries_input_body: AddCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2362,12 +2375,14 @@ def v3_create_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a collection. + """Add binaries to a collection. - Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Links the supplied binaries to a collection without affecting any binaries already linked. Binary IDs already linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param create_collection_input_body: (required) - :type create_collection_input_body: CreateCollectionInputBody + :param collection_id: (required) + :type collection_id: int + :param add_collection_binaries_input_body: (required) + :type add_collection_binaries_input_body: AddCollectionBinariesInputBody :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 @@ -2390,8 +2405,9 @@ def v3_create_collection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_create_collection_serialize( - create_collection_input_body=create_collection_input_body, + _param = self._v3_add_collection_binaries_serialize( + collection_id=collection_id, + add_collection_binaries_input_body=add_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2399,7 +2415,8 @@ def v3_create_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", '422': "APIError", '500': "APIError", @@ -2411,9 +2428,10 @@ def v3_create_collection_without_preload_content( return response_data.response - def _v3_create_collection_serialize( + def _v3_add_collection_binaries_serialize( self, - create_collection_input_body, + collection_id, + add_collection_binaries_input_body, _request_auth, _content_type, _headers, @@ -2435,12 +2453,14 @@ def _v3_create_collection_serialize( _body_params: Optional[bytes] = None # process the path parameters + if collection_id is not None: + _path_params['collection_id'] = collection_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_collection_input_body is not None: - _body_params = create_collection_input_body + if add_collection_binaries_input_body is not None: + _body_params = add_collection_binaries_input_body # set the HTTP header `Accept` @@ -2473,7 +2493,7 @@ def _v3_create_collection_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v3/collections', + resource_path='/v3/collections/{collection_id}/binaries', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2490,9 +2510,9 @@ def _v3_create_collection_serialize( @validate_call - def v3_delete_collection( + def v3_create_collection( self, - collection_id: Annotated[int, Field(strict=True, ge=1)], + create_collection_input_body: CreateCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2505,13 +2525,13 @@ def v3_delete_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a collection. + ) -> CreateCollectionOutputBody: + """Create a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param collection_id: (required) - :type collection_id: int + :param create_collection_input_body: (required) + :type create_collection_input_body: CreateCollectionInputBody :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 @@ -2534,8 +2554,8 @@ def v3_delete_collection( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_delete_collection_serialize( - collection_id=collection_id, + _param = self._v3_create_collection_serialize( + create_collection_input_body=create_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2543,10 +2563,8 @@ def v3_delete_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "APIError", + '201': "CreateCollectionOutputBody", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2562,9 +2580,9 @@ def v3_delete_collection( @validate_call - def v3_delete_collection_with_http_info( + def v3_create_collection_with_http_info( self, - collection_id: Annotated[int, Field(strict=True, ge=1)], + create_collection_input_body: CreateCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2577,13 +2595,13 @@ def v3_delete_collection_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[None]: - """Delete a collection. + ) -> ApiResponse[CreateCollectionOutputBody]: + """Create a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param collection_id: (required) - :type collection_id: int + :param create_collection_input_body: (required) + :type create_collection_input_body: CreateCollectionInputBody :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 @@ -2606,8 +2624,8 @@ def v3_delete_collection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_delete_collection_serialize( - collection_id=collection_id, + _param = self._v3_create_collection_serialize( + create_collection_input_body=create_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2615,10 +2633,8 @@ def v3_delete_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "APIError", + '201': "CreateCollectionOutputBody", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2634,9 +2650,9 @@ def v3_delete_collection_with_http_info( @validate_call - def v3_delete_collection_without_preload_content( + def v3_create_collection_without_preload_content( self, - collection_id: Annotated[int, Field(strict=True, ge=1)], + create_collection_input_body: CreateCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2650,12 +2666,12 @@ def v3_delete_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a collection. + """Create a collection. - Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict + Creates a new collection, optionally tagging it and linking binary IDs to it. Tags and binaries are returned in the response only when they were supplied in the request. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param collection_id: (required) - :type collection_id: int + :param create_collection_input_body: (required) + :type create_collection_input_body: CreateCollectionInputBody :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 @@ -2678,8 +2694,8 @@ def v3_delete_collection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_delete_collection_serialize( - collection_id=collection_id, + _param = self._v3_create_collection_serialize( + create_collection_input_body=create_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2687,10 +2703,8 @@ def v3_delete_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "APIError", + '201': "CreateCollectionOutputBody", '404': "APIError", - '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2701,9 +2715,9 @@ def v3_delete_collection_without_preload_content( return response_data.response - def _v3_delete_collection_serialize( + def _v3_create_collection_serialize( self, - collection_id, + create_collection_input_body, _request_auth, _content_type, _headers, @@ -2725,12 +2739,12 @@ def _v3_delete_collection_serialize( _body_params: Optional[bytes] = None # process the path parameters - if collection_id is not None: - _path_params['collection_id'] = collection_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_collection_input_body is not None: + _body_params = create_collection_input_body # set the HTTP header `Accept` @@ -2741,6 +2755,19 @@ def _v3_delete_collection_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] = [ @@ -2749,8 +2776,8 @@ def _v3_delete_collection_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/v3/collections/{collection_id}', + method='POST', + resource_path='/v3/collections', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2767,14 +2794,9 @@ def _v3_delete_collection_serialize( @validate_call - def v3_get_collection( + def v3_delete_collection( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - include_tags: Optional[StrictBool] = None, - include_binaries: Optional[StrictBool] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - binary_search_str: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2787,23 +2809,13 @@ def v3_get_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetCollectionOutputBody: - """Get a collection. + ) -> None: + """Delete a collection. - Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict :param collection_id: (required) :type collection_id: int - :param include_tags: - :type include_tags: bool - :param include_binaries: - :type include_binaries: bool - :param page_size: - :type page_size: int - :param page_number: - :type page_number: int - :param binary_search_str: - :type binary_search_str: str :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 @@ -2826,13 +2838,8 @@ def v3_get_collection( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_collection_serialize( + _param = self._v3_delete_collection_serialize( collection_id=collection_id, - include_tags=include_tags, - include_binaries=include_binaries, - page_size=page_size, - page_number=page_number, - binary_search_str=binary_search_str, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2840,8 +2847,10 @@ def v3_get_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2857,14 +2866,9 @@ def v3_get_collection( @validate_call - def v3_get_collection_with_http_info( + def v3_delete_collection_with_http_info( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - include_tags: Optional[StrictBool] = None, - include_binaries: Optional[StrictBool] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - binary_search_str: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2877,23 +2881,13 @@ def v3_get_collection_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[GetCollectionOutputBody]: - """Get a collection. + ) -> ApiResponse[None]: + """Delete a collection. - Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict :param collection_id: (required) :type collection_id: int - :param include_tags: - :type include_tags: bool - :param include_binaries: - :type include_binaries: bool - :param page_size: - :type page_size: int - :param page_number: - :type page_number: int - :param binary_search_str: - :type binary_search_str: str :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 @@ -2916,13 +2910,8 @@ def v3_get_collection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_collection_serialize( + _param = self._v3_delete_collection_serialize( collection_id=collection_id, - include_tags=include_tags, - include_binaries=include_binaries, - page_size=page_size, - page_number=page_number, - binary_search_str=binary_search_str, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2930,8 +2919,10 @@ def v3_get_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -2947,14 +2938,9 @@ def v3_get_collection_with_http_info( @validate_call - def v3_get_collection_without_preload_content( + def v3_delete_collection_without_preload_content( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - include_tags: Optional[StrictBool] = None, - include_binaries: Optional[StrictBool] = None, - page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - binary_search_str: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2968,22 +2954,12 @@ def v3_get_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get a collection. + """Delete a collection. - Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + Deletes a collection. The collection must not have any linked binaries (call PATCH /v3/collections/{collection_id}/binaries with an empty list first). **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `409` [`CONFLICT`](/errors/CONFLICT) — Conflict :param collection_id: (required) :type collection_id: int - :param include_tags: - :type include_tags: bool - :param include_binaries: - :type include_binaries: bool - :param page_size: - :type page_size: int - :param page_number: - :type page_number: int - :param binary_search_str: - :type binary_search_str: str :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 @@ -3006,13 +2982,8 @@ def v3_get_collection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_get_collection_serialize( + _param = self._v3_delete_collection_serialize( collection_id=collection_id, - include_tags=include_tags, - include_binaries=include_binaries, - page_size=page_size, - page_number=page_number, - binary_search_str=binary_search_str, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3020,8 +2991,10 @@ def v3_get_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCollectionOutputBody", + '204': None, + '403': "APIError", '404': "APIError", + '409': "APIError", '422': "APIError", '500': "APIError", } @@ -3032,14 +3005,9 @@ def v3_get_collection_without_preload_content( return response_data.response - def _v3_get_collection_serialize( + def _v3_delete_collection_serialize( self, collection_id, - include_tags, - include_binaries, - page_size, - page_number, - binary_search_str, _request_auth, _content_type, _headers, @@ -3064,25 +3032,717 @@ def _v3_get_collection_serialize( if collection_id is not None: _path_params['collection_id'] = collection_id # process the query parameters - if include_tags is not None: - + # 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', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v3/collections/{collection_id}', + 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 + ) + + + + + @validate_call + def v3_get_collection( + self, + collection_id: Annotated[int, Field(strict=True, ge=1)], + include_tags: Optional[StrictBool] = None, + include_binaries: Optional[StrictBool] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + binary_search_str: Optional[StrictStr] = None, + _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, + ) -> GetCollectionOutputBody: + """Get a collection. + + Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param collection_id: (required) + :type collection_id: int + :param include_tags: + :type include_tags: bool + :param include_binaries: + :type include_binaries: bool + :param page_size: + :type page_size: int + :param page_number: + :type page_number: int + :param binary_search_str: + :type binary_search_str: str + :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._v3_get_collection_serialize( + collection_id=collection_id, + include_tags=include_tags, + include_binaries=include_binaries, + page_size=page_size, + page_number=page_number, + binary_search_str=binary_search_str, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCollectionOutputBody", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + 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 v3_get_collection_with_http_info( + self, + collection_id: Annotated[int, Field(strict=True, ge=1)], + include_tags: Optional[StrictBool] = None, + include_binaries: Optional[StrictBool] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + binary_search_str: Optional[StrictStr] = None, + _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[GetCollectionOutputBody]: + """Get a collection. + + Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param collection_id: (required) + :type collection_id: int + :param include_tags: + :type include_tags: bool + :param include_binaries: + :type include_binaries: bool + :param page_size: + :type page_size: int + :param page_number: + :type page_number: int + :param binary_search_str: + :type binary_search_str: str + :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._v3_get_collection_serialize( + collection_id=collection_id, + include_tags=include_tags, + include_binaries=include_binaries, + page_size=page_size, + page_number=page_number, + binary_search_str=binary_search_str, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCollectionOutputBody", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + 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 v3_get_collection_without_preload_content( + self, + collection_id: Annotated[int, Field(strict=True, ge=1)], + include_tags: Optional[StrictBool] = None, + include_binaries: Optional[StrictBool] = None, + page_size: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, + binary_search_str: Optional[StrictStr] = None, + _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 a collection. + + Gets a single collection by ID. Optionally include tags and paginated binaries. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found + + :param collection_id: (required) + :type collection_id: int + :param include_tags: + :type include_tags: bool + :param include_binaries: + :type include_binaries: bool + :param page_size: + :type page_size: int + :param page_number: + :type page_number: int + :param binary_search_str: + :type binary_search_str: str + :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._v3_get_collection_serialize( + collection_id=collection_id, + include_tags=include_tags, + include_binaries=include_binaries, + page_size=page_size, + page_number=page_number, + binary_search_str=binary_search_str, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCollectionOutputBody", + '404': "APIError", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_get_collection_serialize( + self, + collection_id, + include_tags, + include_binaries, + page_size, + page_number, + binary_search_str, + _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 + if collection_id is not None: + _path_params['collection_id'] = collection_id + # process the query parameters + if include_tags is not None: + _query_params.append(('include_tags', include_tags)) - if include_binaries is not None: + if include_binaries is not None: + + _query_params.append(('include_binaries', include_binaries)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if page_number is not None: + + _query_params.append(('page_number', page_number)) + + if binary_search_str is not None: + + _query_params.append(('binary_search_str', binary_search_str)) + + # 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', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v3/collections/{collection_id}', + 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 + ) + + + + + @validate_call + def v3_list_collections( + self, + search_term: Optional[StrictStr] = None, + filters: Optional[List[StrictStr]] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, + _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, + ) -> ListCollectionsOutputBody: + """List collections. + + Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param search_term: + :type search_term: str + :param filters: + :type filters: List[str] + :param limit: + :type limit: int + :param offset: + :type offset: int + :param order_by: + :type order_by: str + :param order: + :type order: str + :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._v3_list_collections_serialize( + search_term=search_term, + filters=filters, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCollectionsOutputBody", + '422': "APIError", + '500': "APIError", + } + 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 v3_list_collections_with_http_info( + self, + search_term: Optional[StrictStr] = None, + filters: Optional[List[StrictStr]] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, + _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[ListCollectionsOutputBody]: + """List collections. + + Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param search_term: + :type search_term: str + :param filters: + :type filters: List[str] + :param limit: + :type limit: int + :param offset: + :type offset: int + :param order_by: + :type order_by: str + :param order: + :type order: str + :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._v3_list_collections_serialize( + search_term=search_term, + filters=filters, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCollectionsOutputBody", + '422': "APIError", + '500': "APIError", + } + 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 v3_list_collections_without_preload_content( + self, + search_term: Optional[StrictStr] = None, + filters: Optional[List[StrictStr]] = None, + limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + order_by: Optional[StrictStr] = None, + order: Optional[StrictStr] = None, + _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: + """List collections. + + Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param search_term: + :type search_term: str + :param filters: + :type filters: List[str] + :param limit: + :type limit: int + :param offset: + :type offset: int + :param order_by: + :type order_by: str + :param order: + :type order: str + :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._v3_list_collections_serialize( + search_term=search_term, + filters=filters, + limit=limit, + offset=offset, + order_by=order_by, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCollectionsOutputBody", + '422': "APIError", + '500': "APIError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _v3_list_collections_serialize( + self, + search_term, + filters, + limit, + offset, + order_by, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'filters': 'csv', + } + + _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 + if search_term is not None: + + _query_params.append(('search_term', search_term)) - _query_params.append(('include_binaries', include_binaries)) + if filters is not None: - if page_size is not None: + _query_params.append(('filters', filters)) - _query_params.append(('page_size', page_size)) + if limit is not None: - if page_number is not None: + _query_params.append(('limit', limit)) - _query_params.append(('page_number', page_number)) + if offset is not None: - if binary_search_str is not None: + _query_params.append(('offset', offset)) - _query_params.append(('binary_search_str', binary_search_str)) + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if order is not None: + + _query_params.append(('order', order)) # process the header parameters # process the form parameters @@ -3106,7 +3766,7 @@ def _v3_get_collection_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v3/collections/{collection_id}', + resource_path='/v3/collections', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3123,14 +3783,10 @@ def _v3_get_collection_serialize( @validate_call - def v3_list_collections( + def v3_patch_collection( self, - search_term: Optional[StrictStr] = None, - filters: Optional[List[StrictStr]] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + collection_id: Annotated[int, Field(strict=True, ge=1)], + patch_collection_input_body: PatchCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3143,23 +3799,15 @@ def v3_list_collections( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListCollectionsOutputBody: - """List collections. + ) -> PatchCollectionOutputBody: + """Update a collection. - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param search_term: - :type search_term: str - :param filters: - :type filters: List[str] - :param limit: - :type limit: int - :param offset: - :type offset: int - :param order_by: - :type order_by: str - :param order: - :type order: str + :param collection_id: (required) + :type collection_id: int + :param patch_collection_input_body: (required) + :type patch_collection_input_body: PatchCollectionInputBody :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 @@ -3182,13 +3830,9 @@ def v3_list_collections( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_collections_serialize( - search_term=search_term, - filters=filters, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._v3_patch_collection_serialize( + collection_id=collection_id, + patch_collection_input_body=patch_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3196,7 +3840,9 @@ def v3_list_collections( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCollectionsOutputBody", + '200': "PatchCollectionOutputBody", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -3212,14 +3858,10 @@ def v3_list_collections( @validate_call - def v3_list_collections_with_http_info( + def v3_patch_collection_with_http_info( self, - search_term: Optional[StrictStr] = None, - filters: Optional[List[StrictStr]] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + collection_id: Annotated[int, Field(strict=True, ge=1)], + patch_collection_input_body: PatchCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3232,23 +3874,15 @@ def v3_list_collections_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[ListCollectionsOutputBody]: - """List collections. + ) -> ApiResponse[PatchCollectionOutputBody]: + """Update a collection. - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - :param search_term: - :type search_term: str - :param filters: - :type filters: List[str] - :param limit: - :type limit: int - :param offset: - :type offset: int - :param order_by: - :type order_by: str - :param order: - :type order: str + :param collection_id: (required) + :type collection_id: int + :param patch_collection_input_body: (required) + :type patch_collection_input_body: PatchCollectionInputBody :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 @@ -3271,13 +3905,9 @@ def v3_list_collections_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_collections_serialize( - search_term=search_term, - filters=filters, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._v3_patch_collection_serialize( + collection_id=collection_id, + patch_collection_input_body=patch_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3285,7 +3915,9 @@ def v3_list_collections_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCollectionsOutputBody", + '200': "PatchCollectionOutputBody", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -3301,14 +3933,10 @@ def v3_list_collections_with_http_info( @validate_call - def v3_list_collections_without_preload_content( + def v3_patch_collection_without_preload_content( self, - search_term: Optional[StrictStr] = None, - filters: Optional[List[StrictStr]] = None, - limit: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None, - offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - order_by: Optional[StrictStr] = None, - order: Optional[StrictStr] = None, + collection_id: Annotated[int, Field(strict=True, ge=1)], + patch_collection_input_body: PatchCollectionInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3322,22 +3950,14 @@ def v3_list_collections_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List collections. - - Lists collections accessible to the authenticated user. Supports search, filtering, ordering, and pagination. **Error codes:** - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed - - :param search_term: - :type search_term: str - :param filters: - :type filters: List[str] - :param limit: - :type limit: int - :param offset: - :type offset: int - :param order_by: - :type order_by: str - :param order: - :type order: str + """Update a collection. + + Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + + :param collection_id: (required) + :type collection_id: int + :param patch_collection_input_body: (required) + :type patch_collection_input_body: PatchCollectionInputBody :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 @@ -3360,13 +3980,9 @@ def v3_list_collections_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_list_collections_serialize( - search_term=search_term, - filters=filters, - limit=limit, - offset=offset, - order_by=order_by, - order=order, + _param = self._v3_patch_collection_serialize( + collection_id=collection_id, + patch_collection_input_body=patch_collection_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3374,7 +3990,9 @@ def v3_list_collections_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListCollectionsOutputBody", + '200': "PatchCollectionOutputBody", + '403': "APIError", + '404': "APIError", '422': "APIError", '500': "APIError", } @@ -3385,14 +4003,10 @@ def v3_list_collections_without_preload_content( return response_data.response - def _v3_list_collections_serialize( + def _v3_patch_collection_serialize( self, - search_term, - filters, - limit, - offset, - order_by, - order, + collection_id, + patch_collection_input_body, _request_auth, _content_type, _headers, @@ -3402,7 +4016,6 @@ def _v3_list_collections_serialize( _host = None _collection_formats: Dict[str, str] = { - 'filters': 'csv', } _path_params: Dict[str, str] = {} @@ -3415,34 +4028,14 @@ def _v3_list_collections_serialize( _body_params: Optional[bytes] = None # process the path parameters + if collection_id is not None: + _path_params['collection_id'] = collection_id # process the query parameters - if search_term is not None: - - _query_params.append(('search_term', search_term)) - - if filters is not None: - - _query_params.append(('filters', filters)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if offset is not None: - - _query_params.append(('offset', offset)) - - if order_by is not None: - - _query_params.append(('order_by', order_by)) - - if order is not None: - - _query_params.append(('order', order)) - # process the header parameters # process the form parameters # process the body parameter + if patch_collection_input_body is not None: + _body_params = patch_collection_input_body # set the HTTP header `Accept` @@ -3453,6 +4046,19 @@ def _v3_list_collections_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] = [ @@ -3461,8 +4067,8 @@ def _v3_list_collections_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v3/collections', + method='PATCH', + resource_path='/v3/collections/{collection_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3479,10 +4085,10 @@ def _v3_list_collections_serialize( @validate_call - def v3_patch_collection( + def v3_patch_collection_binaries( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_input_body: PatchCollectionInputBody, + patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3495,15 +4101,15 @@ def v3_patch_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PatchCollectionOutputBody: - """Update a collection. + ) -> PatchCollectionBinariesOutputBody: + """Replace the binaries in a collection. - Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param collection_id: (required) :type collection_id: int - :param patch_collection_input_body: (required) - :type patch_collection_input_body: PatchCollectionInputBody + :param patch_collection_binaries_input_body: (required) + :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody :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 @@ -3526,9 +4132,9 @@ def v3_patch_collection( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_serialize( + _param = self._v3_patch_collection_binaries_serialize( collection_id=collection_id, - patch_collection_input_body=patch_collection_input_body, + patch_collection_binaries_input_body=patch_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3536,7 +4142,7 @@ def v3_patch_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionOutputBody", + '200': "PatchCollectionBinariesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3554,10 +4160,10 @@ def v3_patch_collection( @validate_call - def v3_patch_collection_with_http_info( + def v3_patch_collection_binaries_with_http_info( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_input_body: PatchCollectionInputBody, + patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3570,15 +4176,15 @@ def v3_patch_collection_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[PatchCollectionOutputBody]: - """Update a collection. + ) -> ApiResponse[PatchCollectionBinariesOutputBody]: + """Replace the binaries in a collection. - Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param collection_id: (required) :type collection_id: int - :param patch_collection_input_body: (required) - :type patch_collection_input_body: PatchCollectionInputBody + :param patch_collection_binaries_input_body: (required) + :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody :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 @@ -3601,9 +4207,9 @@ def v3_patch_collection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_serialize( + _param = self._v3_patch_collection_binaries_serialize( collection_id=collection_id, - patch_collection_input_body=patch_collection_input_body, + patch_collection_binaries_input_body=patch_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3611,7 +4217,7 @@ def v3_patch_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionOutputBody", + '200': "PatchCollectionBinariesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3629,10 +4235,10 @@ def v3_patch_collection_with_http_info( @validate_call - def v3_patch_collection_without_preload_content( + def v3_patch_collection_binaries_without_preload_content( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_input_body: PatchCollectionInputBody, + patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3646,14 +4252,14 @@ def v3_patch_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update a collection. + """Replace the binaries in a collection. - Updates a collection's name, description, and/or scope. Omitted fields keep their existing values. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed :param collection_id: (required) :type collection_id: int - :param patch_collection_input_body: (required) - :type patch_collection_input_body: PatchCollectionInputBody + :param patch_collection_binaries_input_body: (required) + :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody :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 @@ -3676,9 +4282,9 @@ def v3_patch_collection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_serialize( + _param = self._v3_patch_collection_binaries_serialize( collection_id=collection_id, - patch_collection_input_body=patch_collection_input_body, + patch_collection_binaries_input_body=patch_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3686,7 +4292,7 @@ def v3_patch_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionOutputBody", + '200': "PatchCollectionBinariesOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3699,10 +4305,10 @@ def v3_patch_collection_without_preload_content( return response_data.response - def _v3_patch_collection_serialize( + def _v3_patch_collection_binaries_serialize( self, collection_id, - patch_collection_input_body, + patch_collection_binaries_input_body, _request_auth, _content_type, _headers, @@ -3730,8 +4336,8 @@ def _v3_patch_collection_serialize( # process the header parameters # process the form parameters # process the body parameter - if patch_collection_input_body is not None: - _body_params = patch_collection_input_body + if patch_collection_binaries_input_body is not None: + _body_params = patch_collection_binaries_input_body # set the HTTP header `Accept` @@ -3764,7 +4370,7 @@ def _v3_patch_collection_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/v3/collections/{collection_id}', + resource_path='/v3/collections/{collection_id}/binaries', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3781,10 +4387,10 @@ def _v3_patch_collection_serialize( @validate_call - def v3_patch_collection_binaries( + def v3_patch_collection_tags( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, + patch_collection_tags_input_body: PatchCollectionTagsInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3797,15 +4403,15 @@ def v3_patch_collection_binaries( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PatchCollectionBinariesOutputBody: - """Replace the binaries in a collection. + ) -> PatchCollectionTagsOutputBody: + """Replace the tags on a collection. - Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_binaries_input_body: (required) - :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody + :param patch_collection_tags_input_body: (required) + :type patch_collection_tags_input_body: PatchCollectionTagsInputBody :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 @@ -3828,9 +4434,9 @@ def v3_patch_collection_binaries( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_binaries_serialize( + _param = self._v3_patch_collection_tags_serialize( collection_id=collection_id, - patch_collection_binaries_input_body=patch_collection_binaries_input_body, + patch_collection_tags_input_body=patch_collection_tags_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3838,7 +4444,7 @@ def v3_patch_collection_binaries( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionBinariesOutputBody", + '200': "PatchCollectionTagsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3856,10 +4462,10 @@ def v3_patch_collection_binaries( @validate_call - def v3_patch_collection_binaries_with_http_info( + def v3_patch_collection_tags_with_http_info( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, + patch_collection_tags_input_body: PatchCollectionTagsInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3872,15 +4478,15 @@ def v3_patch_collection_binaries_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[PatchCollectionBinariesOutputBody]: - """Replace the binaries in a collection. + ) -> ApiResponse[PatchCollectionTagsOutputBody]: + """Replace the tags on a collection. - Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_binaries_input_body: (required) - :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody + :param patch_collection_tags_input_body: (required) + :type patch_collection_tags_input_body: PatchCollectionTagsInputBody :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 @@ -3903,9 +4509,9 @@ def v3_patch_collection_binaries_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_binaries_serialize( + _param = self._v3_patch_collection_tags_serialize( collection_id=collection_id, - patch_collection_binaries_input_body=patch_collection_binaries_input_body, + patch_collection_tags_input_body=patch_collection_tags_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3913,7 +4519,7 @@ def v3_patch_collection_binaries_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionBinariesOutputBody", + '200': "PatchCollectionTagsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -3931,10 +4537,10 @@ def v3_patch_collection_binaries_with_http_info( @validate_call - def v3_patch_collection_binaries_without_preload_content( + def v3_patch_collection_tags_without_preload_content( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_binaries_input_body: PatchCollectionBinariesInputBody, + patch_collection_tags_input_body: PatchCollectionTagsInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3948,14 +4554,14 @@ def v3_patch_collection_binaries_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Replace the binaries in a collection. + """Replace the tags on a collection. - Replaces the binaries linked to a collection with the supplied list. Binaries not present in the request are removed. All supplied binary IDs must belong to the same model as the collection. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied - `422` [`VALIDATION_FAILED`](/errors/VALIDATION_FAILED) — Validation Failed + Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_binaries_input_body: (required) - :type patch_collection_binaries_input_body: PatchCollectionBinariesInputBody + :param patch_collection_tags_input_body: (required) + :type patch_collection_tags_input_body: PatchCollectionTagsInputBody :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 @@ -3978,9 +4584,9 @@ def v3_patch_collection_binaries_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_binaries_serialize( + _param = self._v3_patch_collection_tags_serialize( collection_id=collection_id, - patch_collection_binaries_input_body=patch_collection_binaries_input_body, + patch_collection_tags_input_body=patch_collection_tags_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3988,7 +4594,7 @@ def v3_patch_collection_binaries_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionBinariesOutputBody", + '200': "PatchCollectionTagsOutputBody", '403': "APIError", '404': "APIError", '422': "APIError", @@ -4001,10 +4607,10 @@ def v3_patch_collection_binaries_without_preload_content( return response_data.response - def _v3_patch_collection_binaries_serialize( + def _v3_patch_collection_tags_serialize( self, collection_id, - patch_collection_binaries_input_body, + patch_collection_tags_input_body, _request_auth, _content_type, _headers, @@ -4032,8 +4638,8 @@ def _v3_patch_collection_binaries_serialize( # process the header parameters # process the form parameters # process the body parameter - if patch_collection_binaries_input_body is not None: - _body_params = patch_collection_binaries_input_body + if patch_collection_tags_input_body is not None: + _body_params = patch_collection_tags_input_body # set the HTTP header `Accept` @@ -4066,7 +4672,7 @@ def _v3_patch_collection_binaries_serialize( return self.api_client.param_serialize( method='PATCH', - resource_path='/v3/collections/{collection_id}/binaries', + resource_path='/v3/collections/{collection_id}/tags', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4083,10 +4689,10 @@ def _v3_patch_collection_binaries_serialize( @validate_call - def v3_patch_collection_tags( + def v3_remove_collection_binaries( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_tags_input_body: PatchCollectionTagsInputBody, + remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4099,15 +4705,15 @@ def v3_patch_collection_tags( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PatchCollectionTagsOutputBody: - """Replace the tags on a collection. + ) -> None: + """Remove binaries from a collection. - Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Unlinks the supplied binaries from a collection without affecting any other binaries linked to it. Binary IDs not linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_tags_input_body: (required) - :type patch_collection_tags_input_body: PatchCollectionTagsInputBody + :param remove_collection_binaries_input_body: (required) + :type remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody :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 @@ -4130,9 +4736,9 @@ def v3_patch_collection_tags( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_tags_serialize( + _param = self._v3_remove_collection_binaries_serialize( collection_id=collection_id, - patch_collection_tags_input_body=patch_collection_tags_input_body, + remove_collection_binaries_input_body=remove_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4140,7 +4746,7 @@ def v3_patch_collection_tags( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionTagsOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -4158,10 +4764,10 @@ def v3_patch_collection_tags( @validate_call - def v3_patch_collection_tags_with_http_info( + def v3_remove_collection_binaries_with_http_info( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_tags_input_body: PatchCollectionTagsInputBody, + remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4174,15 +4780,15 @@ def v3_patch_collection_tags_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[PatchCollectionTagsOutputBody]: - """Replace the tags on a collection. + ) -> ApiResponse[None]: + """Remove binaries from a collection. - Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Unlinks the supplied binaries from a collection without affecting any other binaries linked to it. Binary IDs not linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_tags_input_body: (required) - :type patch_collection_tags_input_body: PatchCollectionTagsInputBody + :param remove_collection_binaries_input_body: (required) + :type remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody :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 @@ -4205,9 +4811,9 @@ def v3_patch_collection_tags_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_tags_serialize( + _param = self._v3_remove_collection_binaries_serialize( collection_id=collection_id, - patch_collection_tags_input_body=patch_collection_tags_input_body, + remove_collection_binaries_input_body=remove_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4215,7 +4821,7 @@ def v3_patch_collection_tags_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionTagsOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -4233,10 +4839,10 @@ def v3_patch_collection_tags_with_http_info( @validate_call - def v3_patch_collection_tags_without_preload_content( + def v3_remove_collection_binaries_without_preload_content( self, collection_id: Annotated[int, Field(strict=True, ge=1)], - patch_collection_tags_input_body: PatchCollectionTagsInputBody, + remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4250,14 +4856,14 @@ def v3_patch_collection_tags_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Replace the tags on a collection. + """Remove binaries from a collection. - Replaces the tags on a collection with the supplied list. Tags not present in the request are removed. Empty or whitespace-only tags are filtered; duplicates are deduplicated. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied + Unlinks the supplied binaries from a collection without affecting any other binaries linked to it. Binary IDs not linked to the collection are ignored. **Error codes:** - `404` [`NOT_FOUND`](/errors/NOT_FOUND) — Not Found - `403` [`ACCESS_DENIED`](/errors/ACCESS_DENIED) — Access Denied :param collection_id: (required) :type collection_id: int - :param patch_collection_tags_input_body: (required) - :type patch_collection_tags_input_body: PatchCollectionTagsInputBody + :param remove_collection_binaries_input_body: (required) + :type remove_collection_binaries_input_body: RemoveCollectionBinariesInputBody :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 @@ -4280,9 +4886,9 @@ def v3_patch_collection_tags_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._v3_patch_collection_tags_serialize( + _param = self._v3_remove_collection_binaries_serialize( collection_id=collection_id, - patch_collection_tags_input_body=patch_collection_tags_input_body, + remove_collection_binaries_input_body=remove_collection_binaries_input_body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4290,7 +4896,7 @@ def v3_patch_collection_tags_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PatchCollectionTagsOutputBody", + '204': None, '403': "APIError", '404': "APIError", '422': "APIError", @@ -4303,10 +4909,10 @@ def v3_patch_collection_tags_without_preload_content( return response_data.response - def _v3_patch_collection_tags_serialize( + def _v3_remove_collection_binaries_serialize( self, collection_id, - patch_collection_tags_input_body, + remove_collection_binaries_input_body, _request_auth, _content_type, _headers, @@ -4334,8 +4940,8 @@ def _v3_patch_collection_tags_serialize( # process the header parameters # process the form parameters # process the body parameter - if patch_collection_tags_input_body is not None: - _body_params = patch_collection_tags_input_body + if remove_collection_binaries_input_body is not None: + _body_params = remove_collection_binaries_input_body # set the HTTP header `Accept` @@ -4367,8 +4973,8 @@ def _v3_patch_collection_tags_serialize( ] return self.api_client.param_serialize( - method='PATCH', - resource_path='/v3/collections/{collection_id}/tags', + method='DELETE', + resource_path='/v3/collections/{collection_id}/binaries', 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 39cb5d03..0cc8e6a1 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.124.0/python' + self.user_agent = 'OpenAPI-Generator/v3.129.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/revengai/configuration.py b/revengai/configuration.py index 32f27499..f15ba4c6 100644 --- a/revengai/configuration.py +++ b/revengai/configuration.py @@ -541,8 +541,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.124.0\n"\ - "SDK Package Version: v3.124.0".\ + "Version of the API: v3.129.1\n"\ + "SDK Package Version: v3.129.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 7f78b1fb..231b366e 100644 --- a/revengai/models/__init__.py +++ b/revengai/models/__init__.py @@ -17,6 +17,7 @@ from revengai.models.ai_decomp_inverse_string_map_item import AIDecompInverseStringMapItem from revengai.models.api_error import APIError from revengai.models.add_callee_input_body import AddCalleeInputBody +from revengai.models.add_collection_binaries_input_body import AddCollectionBinariesInputBody from revengai.models.add_issuer_domain_input_body import AddIssuerDomainInputBody from revengai.models.add_owner_input_body import AddOwnerInputBody from revengai.models.add_team_member_input_body import AddTeamMemberInputBody @@ -401,6 +402,7 @@ from revengai.models.register_user_input_body import RegisterUserInputBody from revengai.models.registry_operation import RegistryOperation from revengai.models.relative_binary_response import RelativeBinaryResponse +from revengai.models.remove_collection_binaries_input_body import RemoveCollectionBinariesInputBody from revengai.models.rename_applied_event import RenameAppliedEvent from revengai.models.rename_input_body import RenameInputBody from revengai.models.rename_output_body import RenameOutputBody diff --git a/revengai/models/add_collection_binaries_input_body.py b/revengai/models/add_collection_binaries_input_body.py new file mode 100644 index 00000000..4ecdb9f9 --- /dev/null +++ b/revengai/models/add_collection_binaries_input_body.py @@ -0,0 +1,104 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AddCollectionBinariesInputBody(BaseModel): + """ + AddCollectionBinariesInputBody + """ # noqa: E501 + binaries: Optional[List[StrictInt]] = Field(description="Binary IDs to add to the collection. Binary IDs already linked to the collection are ignored.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binaries"] + + 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 AddCollectionBinariesInputBody 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 binaries (nullable) is None + # and model_fields_set contains the field + if self.binaries is None and "binaries" in self.model_fields_set: + _dict['binaries'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddCollectionBinariesInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binaries": obj.get("binaries") + }) + # 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/product_output.py b/revengai/models/product_output.py index 52bba1ad..04983010 100644 --- a/revengai/models/product_output.py +++ b/revengai/models/product_output.py @@ -16,7 +16,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from revengai.models.price_output import PriceOutput from typing import Optional, Set @@ -32,9 +32,10 @@ class ProductOutput(BaseModel): id: StrictStr = Field(description="Product ID.") name: StrictStr = Field(description="Human-readable product name.") prices: Optional[List[PriceOutput]] = Field(description="All active recurring prices for this product.") + sales_only: StrictBool = Field(description="When true, this product is not self-serve purchasable and must be bought via direct sales.") tier: Optional[StrictStr] = Field(default=None, description="User tier associated with this product, if any.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["credits_per_month", "description", "features", "id", "name", "prices", "tier"] + __properties: ClassVar[List[str]] = ["credits_per_month", "description", "features", "id", "name", "prices", "sales_only", "tier"] model_config = ConfigDict( populate_by_name=True, @@ -117,6 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "name": obj.get("name"), "prices": [PriceOutput.from_dict(_item) for _item in obj["prices"]] if obj.get("prices") is not None else None, + "sales_only": obj.get("sales_only"), "tier": obj.get("tier") }) # store additional fields in additional_properties diff --git a/revengai/models/remove_collection_binaries_input_body.py b/revengai/models/remove_collection_binaries_input_body.py new file mode 100644 index 00000000..478f602d --- /dev/null +++ b/revengai/models/remove_collection_binaries_input_body.py @@ -0,0 +1,104 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RemoveCollectionBinariesInputBody(BaseModel): + """ + RemoveCollectionBinariesInputBody + """ # noqa: E501 + binaries: Optional[List[StrictInt]] = Field(description="Binary IDs to remove from the collection. Binary IDs not linked to the collection are ignored.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["binaries"] + + 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 RemoveCollectionBinariesInputBody 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 binaries (nullable) is None + # and model_fields_set contains the field + if self.binaries is None and "binaries" in self.model_fields_set: + _dict['binaries'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RemoveCollectionBinariesInputBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "binaries": obj.get("binaries") + }) + # 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 + +