From b87cc6a023f115eb3e413250498bab706c121202 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Wed, 11 Dec 2024 17:13:15 +0000 Subject: [PATCH] fix(specs): enable watcher for push [skip-bc] (generated) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/algolia/api-clients-automation/pull/4229 Co-authored-by: algolia-bot Co-authored-by: Clément Vannicatte --- algoliasearch/ingestion/client.py | 50 +++++++++---------- ...ce_watch_response.py => watch_response.py} | 10 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) rename algoliasearch/ingestion/models/{source_watch_response.py => watch_response.py} (87%) diff --git a/algoliasearch/ingestion/client.py b/algoliasearch/ingestion/client.py index 187eaa69d..1a6facbcd 100644 --- a/algoliasearch/ingestion/client.py +++ b/algoliasearch/ingestion/client.py @@ -92,7 +92,6 @@ from algoliasearch.ingestion.models.source_type import SourceType from algoliasearch.ingestion.models.source_update import SourceUpdate from algoliasearch.ingestion.models.source_update_response import SourceUpdateResponse -from algoliasearch.ingestion.models.source_watch_response import SourceWatchResponse from algoliasearch.ingestion.models.task import Task from algoliasearch.ingestion.models.task_create import TaskCreate from algoliasearch.ingestion.models.task_create_response import TaskCreateResponse @@ -120,6 +119,7 @@ TransformationUpdateResponse, ) from algoliasearch.ingestion.models.trigger_type import TriggerType +from algoliasearch.ingestion.models.watch_response import WatchResponse class IngestionClient: @@ -3538,7 +3538,7 @@ async def push_task( ), ] = None, request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> RunResponse: + ) -> WatchResponse: """ Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. @@ -3554,12 +3554,12 @@ async def push_task( :param watch: When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. :type watch: bool :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'RunResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = await self.push_task_with_http_info( task_id, push_task_payload, watch, request_options ) - return resp.deserialize(RunResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) async def run_source_with_http_info( self, @@ -4155,7 +4155,7 @@ async def trigger_docker_source_discover( StrictStr, Field(description="Unique identifier of a source.") ], request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`. @@ -4167,12 +4167,12 @@ async def trigger_docker_source_discover( :param source_id: Unique identifier of a source. (required) :type source_id: str :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = await self.trigger_docker_source_discover_with_http_info( source_id, request_options ) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) async def try_transformation_with_http_info( self, @@ -4792,7 +4792,7 @@ async def validate_source( self, source_create: Union[Optional[SourceCreate], dict[str, Any]] = None, request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Validates a source payload to ensure it can be created and that the data source can be reached by Algolia. @@ -4804,10 +4804,10 @@ async def validate_source( :param source_create: :type source_create: SourceCreate :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = await self.validate_source_with_http_info(source_create, request_options) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) async def validate_source_before_update_with_http_info( self, @@ -4866,7 +4866,7 @@ async def validate_source_before_update( ], source_update: Union[SourceUpdate, dict[str, Any]], request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia. @@ -4880,12 +4880,12 @@ async def validate_source_before_update( :param source_update: (required) :type source_update: SourceUpdate :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = await self.validate_source_before_update_with_http_info( source_id, source_update, request_options ) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) class IngestionClientSync: @@ -8293,7 +8293,7 @@ def push_task( ), ] = None, request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> RunResponse: + ) -> WatchResponse: """ Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. @@ -8309,12 +8309,12 @@ def push_task( :param watch: When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding. :type watch: bool :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'RunResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = self.push_task_with_http_info( task_id, push_task_payload, watch, request_options ) - return resp.deserialize(RunResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) def run_source_with_http_info( self, @@ -8910,7 +8910,7 @@ def trigger_docker_source_discover( StrictStr, Field(description="Unique identifier of a source.") ], request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`. @@ -8922,12 +8922,12 @@ def trigger_docker_source_discover( :param source_id: Unique identifier of a source. (required) :type source_id: str :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = self.trigger_docker_source_discover_with_http_info( source_id, request_options ) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) def try_transformation_with_http_info( self, @@ -9543,7 +9543,7 @@ def validate_source( self, source_create: Union[Optional[SourceCreate], dict[str, Any]] = None, request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Validates a source payload to ensure it can be created and that the data source can be reached by Algolia. @@ -9555,10 +9555,10 @@ def validate_source( :param source_create: :type source_create: SourceCreate :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = self.validate_source_with_http_info(source_create, request_options) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) def validate_source_before_update_with_http_info( self, @@ -9617,7 +9617,7 @@ def validate_source_before_update( ], source_update: Union[SourceUpdate, dict[str, Any]], request_options: Optional[Union[dict, RequestOptions]] = None, - ) -> SourceWatchResponse: + ) -> WatchResponse: """ Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia. @@ -9631,9 +9631,9 @@ def validate_source_before_update( :param source_update: (required) :type source_update: SourceUpdate :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) - :return: Returns the deserialized response in a 'SourceWatchResponse' result object. + :return: Returns the deserialized response in a 'WatchResponse' result object. """ resp = self.validate_source_before_update_with_http_info( source_id, source_update, request_options ) - return resp.deserialize(SourceWatchResponse, resp.raw_data) + return resp.deserialize(WatchResponse, resp.raw_data) diff --git a/algoliasearch/ingestion/models/source_watch_response.py b/algoliasearch/ingestion/models/watch_response.py similarity index 87% rename from algoliasearch/ingestion/models/source_watch_response.py rename to algoliasearch/ingestion/models/watch_response.py index d6256c89f..cb19a6fac 100644 --- a/algoliasearch/ingestion/models/source_watch_response.py +++ b/algoliasearch/ingestion/models/watch_response.py @@ -32,15 +32,15 @@ def _alias_generator(name: str) -> str: return _ALIASES.get(name, name) -class SourceWatchResponse(BaseModel): +class WatchResponse(BaseModel): """ - SourceWatchResponse + WatchResponse """ run_id: Optional[str] = None """ Universally unique identifier (UUID) of a task run. """ data: Optional[List[object]] = None - """ depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery). """ + """ when used with discovering or validating sources, the sampled data of your source is returned. """ events: Optional[List[Event]] = None """ in case of error, observability events will be added to the response, if any. """ message: str @@ -59,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SourceWatchResponse from a JSON string""" + """Create an instance of WatchResponse from a JSON string""" return cls.from_dict(loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SourceWatchResponse from a dict""" + """Create an instance of WatchResponse from a dict""" if obj is None: return None