From 43920de24a0c3f2f810a4fc35dbd3ad6fdee6643 Mon Sep 17 00:00:00 2001 From: adeprezh <185077910+adeprezh@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:43:30 +0000 Subject: [PATCH] chore(sdk): sync to agent_platform@faadbed (v1.0.4) --- openapi.json | 60 ++++++++++ pyproject.toml | 2 +- src/hai_agents/__init__.py | 3 + src/hai_agents/core/client_wrapper.py | 4 +- src/hai_agents/types/__init__.py | 3 + .../types/webhook_event_type_definition.py | 24 ++++ src/hai_agents/webhooks/client.py | 65 +++++++++++ src/hai_agents/webhooks/raw_client.py | 103 ++++++++++++++++++ uv.lock | 2 +- 9 files changed, 262 insertions(+), 4 deletions(-) create mode 100644 src/hai_agents/types/webhook_event_type_definition.py diff --git a/openapi.json b/openapi.json index 18f48c6..19e0037 100644 --- a/openapi.json +++ b/openapi.json @@ -2552,6 +2552,47 @@ } } }, + "/api/v2/webhooks/events": { + "get": { + "tags": [ + "Webhooks" + ], + "summary": "List Webhook Events", + "description": "List concrete webhook event types clients can subscribe to.", + "operationId": "list_webhook_events_api_v2_webhooks_events_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/WebhookEventTypeDefinition" + }, + "type": "array", + "title": "Response List Webhook Events Api V2 Webhooks Events Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ] + } + }, "/api/v2/webhooks/{webhook_id}": { "get": { "tags": [ @@ -6422,6 +6463,25 @@ "title": "VaultUpdateRequest", "description": "Partial update; only provided fields are forwarded. Token rotation is separate." }, + "WebhookEventTypeDefinition": { + "properties": { + "type": { + "type": "string", + "title": "Type" + }, + "description": { + "type": "string", + "title": "Description" + } + }, + "type": "object", + "required": [ + "type", + "description" + ], + "title": "WebhookEventTypeDefinition", + "description": "A webhook event type clients can subscribe to." + }, "WebhookRecord": { "properties": { "id": { diff --git a/pyproject.toml b/pyproject.toml index afc976f..d2223e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "hai-agents" -version = "1.0.3" +version = "1.0.4" description = "Python SDK for H Company's Computer-Use Agents: autonomous agents powered by Holo." requires-python = ">=3.10" readme = "README.md" diff --git a/src/hai_agents/__init__.py b/src/hai_agents/__init__.py index 660af3b..f24a202 100644 --- a/src/hai_agents/__init__.py +++ b/src/hai_agents/__init__.py @@ -123,6 +123,7 @@ VaultConfigList, VaultConfigRead, VaultHealth, + WebhookEventTypeDefinition, WebhookRecord, WebhookWithSecret, ) @@ -325,6 +326,7 @@ "VaultHealth": ".types", "WebhookEvent": ".webhook_verification", "WebhookEventData": ".webhook_verification", + "WebhookEventTypeDefinition": ".types", "WebhookRecord": ".types", "WebhookVerificationError": ".webhook_verification", "WebhookWithSecret": ".types", @@ -523,6 +525,7 @@ def __dir__(): "VaultHealth", "WebhookEvent", "WebhookEventData", + "WebhookEventTypeDefinition", "WebhookRecord", "WebhookVerificationError", "WebhookWithSecret", diff --git a/src/hai_agents/core/client_wrapper.py b/src/hai_agents/core/client_wrapper.py index f1f815e..627778e 100644 --- a/src/hai_agents/core/client_wrapper.py +++ b/src/hai_agents/core/client_wrapper.py @@ -29,9 +29,9 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "hai_agents/1.0.3", + "User-Agent": "hai_agents/1.0.4", "X-HCompany-Client-Name": "hai_agents", - "X-HCompany-Client-Version": "1.0.3", + "X-HCompany-Client-Version": "1.0.4", "X-HCompany-Client-Type": "sdk", "X-HCompany-Language": "Python", "X-HCompany-Runtime": f"python/{platform.python_version()}", diff --git a/src/hai_agents/types/__init__.py b/src/hai_agents/types/__init__.py index 184fa49..7c66b21 100644 --- a/src/hai_agents/types/__init__.py +++ b/src/hai_agents/types/__init__.py @@ -126,6 +126,7 @@ from .vault_config_list import VaultConfigList from .vault_config_read import VaultConfigRead from .vault_health import VaultHealth + from .webhook_event_type_definition import WebhookEventTypeDefinition from .webhook_record import WebhookRecord from .webhook_with_secret import WebhookWithSecret _dynamic_imports: typing.Dict[str, str] = { @@ -245,6 +246,7 @@ "VaultConfigList": ".vault_config_list", "VaultConfigRead": ".vault_config_read", "VaultHealth": ".vault_health", + "WebhookEventTypeDefinition": ".webhook_event_type_definition", "WebhookRecord": ".webhook_record", "WebhookWithSecret": ".webhook_with_secret", } @@ -388,6 +390,7 @@ def __dir__(): "VaultConfigList", "VaultConfigRead", "VaultHealth", + "WebhookEventTypeDefinition", "WebhookRecord", "WebhookWithSecret", ] diff --git a/src/hai_agents/types/webhook_event_type_definition.py b/src/hai_agents/types/webhook_event_type_definition.py new file mode 100644 index 0000000..6e925e5 --- /dev/null +++ b/src/hai_agents/types/webhook_event_type_definition.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class WebhookEventTypeDefinition(UniversalBaseModel): + """ + A webhook event type clients can subscribe to. + """ + + type: str + description: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/hai_agents/webhooks/client.py b/src/hai_agents/webhooks/client.py index 40daa72..b7b61d8 100644 --- a/src/hai_agents/webhooks/client.py +++ b/src/hai_agents/webhooks/client.py @@ -5,6 +5,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions from ..types.page_webhook_record import PageWebhookRecord +from ..types.webhook_event_type_definition import WebhookEventTypeDefinition from ..types.webhook_record import WebhookRecord from ..types.webhook_with_secret import WebhookWithSecret from .raw_client import AsyncRawWebhooksClient, RawWebhooksClient @@ -115,6 +116,34 @@ def create_webhook( ) return _response.data + def list_webhook_events( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[WebhookEventTypeDefinition]: + """ + List concrete webhook event types clients can subscribe to. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[WebhookEventTypeDefinition] + Successful Response + + Examples + -------- + from hai_agents import Client + + client = Client( + api_key="YOUR_API_KEY", + ) + client.webhooks.list_webhook_events() + """ + _response = self._raw_client.list_webhook_events(request_options=request_options) + return _response.data + def get_webhook(self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> WebhookRecord: """ Fetch a webhook by id. @@ -348,6 +377,42 @@ async def main() -> None: ) return _response.data + async def list_webhook_events( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[WebhookEventTypeDefinition]: + """ + List concrete webhook event types clients can subscribe to. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[WebhookEventTypeDefinition] + Successful Response + + Examples + -------- + import asyncio + + from hai_agents import AsyncClient + + client = AsyncClient( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.webhooks.list_webhook_events() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_webhook_events(request_options=request_options) + return _response.data + async def get_webhook( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> WebhookRecord: diff --git a/src/hai_agents/webhooks/raw_client.py b/src/hai_agents/webhooks/raw_client.py index 1f33344..16d7952 100644 --- a/src/hai_agents/webhooks/raw_client.py +++ b/src/hai_agents/webhooks/raw_client.py @@ -13,6 +13,7 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.http_validation_error import HttpValidationError from ..types.page_webhook_record import PageWebhookRecord +from ..types.webhook_event_type_definition import WebhookEventTypeDefinition from ..types.webhook_record import WebhookRecord from ..types.webhook_with_secret import WebhookWithSecret from .types.list_webhooks_request_sort_item import ListWebhooksRequestSortItem @@ -168,6 +169,57 @@ def create_webhook( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def list_webhook_events( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[typing.List[WebhookEventTypeDefinition]]: + """ + List concrete webhook event types clients can subscribe to. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.List[WebhookEventTypeDefinition]] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + "api/v2/webhooks/events", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[WebhookEventTypeDefinition], + parse_obj_as( + type_=typing.List[WebhookEventTypeDefinition], # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + HttpValidationError, + parse_obj_as( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def get_webhook( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[WebhookRecord]: @@ -491,6 +543,57 @@ async def create_webhook( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def list_webhook_events( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[typing.List[WebhookEventTypeDefinition]]: + """ + List concrete webhook event types clients can subscribe to. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.List[WebhookEventTypeDefinition]] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + "api/v2/webhooks/events", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[WebhookEventTypeDefinition], + parse_obj_as( + type_=typing.List[WebhookEventTypeDefinition], # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + HttpValidationError, + parse_obj_as( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def get_webhook( self, webhook_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[WebhookRecord]: diff --git a/uv.lock b/uv.lock index d704e42..fdd8b67 100644 --- a/uv.lock +++ b/uv.lock @@ -88,7 +88,7 @@ wheels = [ [[package]] name = "hai-agents" -version = "1.0.3" +version = "1.0.4" source = { editable = "." } dependencies = [ { name = "httpx" },