Skip to content

Commit

Permalink
fix(specs): enable watcher for push [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4229

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed Dec 11, 2024
1 parent eaf6650 commit b87cc6a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
50 changes: 25 additions & 25 deletions algoliasearch/ingestion/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -120,6 +119,7 @@
TransformationUpdateResponse,
)
from algoliasearch.ingestion.models.trigger_type import TriggerType
from algoliasearch.ingestion.models.watch_response import WatchResponse


class IngestionClient:
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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`.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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`.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]:
Expand All @@ -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

Expand Down

0 comments on commit b87cc6a

Please sign in to comment.