From e32f6e14b2d436d6371715edf8265060a130cbd6 Mon Sep 17 00:00:00 2001 From: "convoy-sdk-bot[bot]" <307218117+convoy-sdk-bot[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 10:08:18 +0000 Subject: [PATCH] feat: regenerate API client from OpenAPI spec --- .../api/events/create_broadcast_event.py | 8 ++ src/convoy/api/events/create_dynamic_event.py | 20 +++-- .../api/events/create_endpoint_event.py | 8 ++ .../events/create_endpoint_fanout_event.py | 8 ++ src/convoy/models/__init__.py | 2 + .../create_broadcast_event_response_201.py | 12 +-- .../create_dynamic_event_response_201.py | 44 +++-------- .../create_endpoint_event_response_201.py | 44 +++-------- ...eate_endpoint_fanout_event_response_201.py | 44 +++-------- .../models/models_event_queued_response.py | 79 +++++++++++++++++++ 10 files changed, 162 insertions(+), 107 deletions(-) create mode 100644 src/convoy/models/models_event_queued_response.py diff --git a/src/convoy/api/events/create_broadcast_event.py b/src/convoy/api/events/create_broadcast_event.py index 4453eab..ac33abd 100644 --- a/src/convoy/api/events/create_broadcast_event.py +++ b/src/convoy/api/events/create_broadcast_event.py @@ -110,6 +110,8 @@ def sync_detailed( This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -151,6 +153,8 @@ def sync( This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -186,6 +190,8 @@ async def asyncio_detailed( This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -225,6 +231,8 @@ async def asyncio( This endpoint creates a event that is broadcast to every endpoint whose subscription matches the given event type. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): diff --git a/src/convoy/api/events/create_dynamic_event.py b/src/convoy/api/events/create_dynamic_event.py index 4c44a4a..6f2d7d7 100644 --- a/src/convoy/api/events/create_dynamic_event.py +++ b/src/convoy/api/events/create_dynamic_event.py @@ -100,8 +100,9 @@ def sync_detailed( ]: """Dynamic Events - This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you - supply the endpoint and the payload, and Convoy delivers the events + This endpoint creates a dynamic event without creating the endpoint and subscription ahead of time. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -141,8 +142,9 @@ def sync( ): """Dynamic Events - This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you - supply the endpoint and the payload, and Convoy delivers the events + This endpoint creates a dynamic event without creating the endpoint and subscription ahead of time. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -176,8 +178,9 @@ async def asyncio_detailed( ]: """Dynamic Events - This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you - supply the endpoint and the payload, and Convoy delivers the events + This endpoint creates a dynamic event without creating the endpoint and subscription ahead of time. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -215,8 +218,9 @@ async def asyncio( ): """Dynamic Events - This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you - supply the endpoint and the payload, and Convoy delivers the events + This endpoint creates a dynamic event without creating the endpoint and subscription ahead of time. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): diff --git a/src/convoy/api/events/create_endpoint_event.py b/src/convoy/api/events/create_endpoint_event.py index 6ce2ec1..87a2c2f 100644 --- a/src/convoy/api/events/create_endpoint_event.py +++ b/src/convoy/api/events/create_endpoint_event.py @@ -101,6 +101,8 @@ def sync_detailed( """Create an event This endpoint creates an endpoint event + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -141,6 +143,8 @@ def sync( """Create an event This endpoint creates an endpoint event + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -175,6 +179,8 @@ async def asyncio_detailed( """Create an event This endpoint creates an endpoint event + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -213,6 +219,8 @@ async def asyncio( """Create an event This endpoint creates an endpoint event + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): diff --git a/src/convoy/api/events/create_endpoint_fanout_event.py b/src/convoy/api/events/create_endpoint_fanout_event.py index ade5e39..f6aa8f3 100644 --- a/src/convoy/api/events/create_endpoint_fanout_event.py +++ b/src/convoy/api/events/create_endpoint_fanout_event.py @@ -109,6 +109,8 @@ def sync_detailed( """Fan out an event This endpoint uses the owner_id to fan out an event to multiple endpoints. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -149,6 +151,8 @@ def sync( """Fan out an event This endpoint uses the owner_id to fan out an event to multiple endpoints. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -183,6 +187,8 @@ async def asyncio_detailed( """Fan out an event This endpoint uses the owner_id to fan out an event to multiple endpoints. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): @@ -221,6 +227,8 @@ async def asyncio( """Fan out an event This endpoint uses the owner_id to fan out an event to multiple endpoints. + The 201 body includes uid (the event id). Use GET /events/{eventID} or GET /eventdeliveries?eventId= + to follow the send. Args: project_id (str): diff --git a/src/convoy/models/__init__.py b/src/convoy/models/__init__.py index 540bdd4..8956248 100644 --- a/src/convoy/models/__init__.py +++ b/src/convoy/models/__init__.py @@ -378,6 +378,7 @@ from .models_endpoint_period_failure_rate import ModelsEndpointPeriodFailureRate from .models_endpoint_response import ModelsEndpointResponse from .models_event_delivery_response import ModelsEventDeliveryResponse +from .models_event_queued_response import ModelsEventQueuedResponse from .models_event_response import ModelsEventResponse from .models_event_response_data_type_0 import ModelsEventResponseDataType0 from .models_event_type_response import ModelsEventTypeResponse @@ -870,6 +871,7 @@ "ModelsEndpointPeriodFailureRate", "ModelsEndpointResponse", "ModelsEventDeliveryResponse", + "ModelsEventQueuedResponse", "ModelsEventResponse", "ModelsEventResponseDataType0", "ModelsEventTypeResponse", diff --git a/src/convoy/models/create_broadcast_event_response_201.py b/src/convoy/models/create_broadcast_event_response_201.py index 1b1ca3c..ea9d038 100644 --- a/src/convoy/models/create_broadcast_event_response_201.py +++ b/src/convoy/models/create_broadcast_event_response_201.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.models_event_response import ModelsEventResponse + from ..models.models_event_queued_response import ModelsEventQueuedResponse T = TypeVar("T", bound="CreateBroadcastEventResponse201") @@ -21,12 +21,12 @@ class CreateBroadcastEventResponse201: Attributes: message (str | Unset): status (bool | Unset): - data (ModelsEventResponse | Unset): + data (ModelsEventQueuedResponse | Unset): """ message: str | Unset = UNSET status: bool | Unset = UNSET - data: ModelsEventResponse | Unset = UNSET + data: ModelsEventQueuedResponse | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.models_event_response import ModelsEventResponse + from ..models.models_event_queued_response import ModelsEventQueuedResponse d = dict(src_dict) message = d.pop("message", UNSET) @@ -60,11 +60,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status", UNSET) _data = d.pop("data", UNSET) - data: ModelsEventResponse | Unset + data: ModelsEventQueuedResponse | Unset if isinstance(_data, Unset): data = UNSET else: - data = ModelsEventResponse.from_dict(_data) + data = ModelsEventQueuedResponse.from_dict(_data) create_broadcast_event_response_201 = cls( message=message, diff --git a/src/convoy/models/create_dynamic_event_response_201.py b/src/convoy/models/create_dynamic_event_response_201.py index c049e7e..9741475 100644 --- a/src/convoy/models/create_dynamic_event_response_201.py +++ b/src/convoy/models/create_dynamic_event_response_201.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse T = TypeVar("T", bound="CreateDynamicEventResponse201") @@ -21,28 +21,22 @@ class CreateDynamicEventResponse201: Attributes: message (str | Unset): status (bool | Unset): - data (HandlersStubType0 | None | Unset): + data (ModelsEventQueuedResponse | Unset): """ message: str | Unset = UNSET status: bool | Unset = UNSET - data: HandlersStubType0 | None | Unset = UNSET + data: ModelsEventQueuedResponse | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.handlers_stub_type_0 import HandlersStubType0 - message = self.message status = self.status - data: dict[str, Any] | None | Unset - if isinstance(self.data, Unset): - data = UNSET - elif isinstance(self.data, HandlersStubType0): + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): data = self.data.to_dict() - else: - data = self.data field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,31 +52,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse d = dict(src_dict) message = d.pop("message", UNSET) status = d.pop("status", UNSET) - def _parse_data(data: object) -> HandlersStubType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - componentsschemashandlers_stub_type_0 = HandlersStubType0.from_dict( - data - ) - - return componentsschemashandlers_stub_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HandlersStubType0 | None | Unset, data) - - data = _parse_data(d.pop("data", UNSET)) + _data = d.pop("data", UNSET) + data: ModelsEventQueuedResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventQueuedResponse.from_dict(_data) create_dynamic_event_response_201 = cls( message=message, diff --git a/src/convoy/models/create_endpoint_event_response_201.py b/src/convoy/models/create_endpoint_event_response_201.py index d57a511..405192d 100644 --- a/src/convoy/models/create_endpoint_event_response_201.py +++ b/src/convoy/models/create_endpoint_event_response_201.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse T = TypeVar("T", bound="CreateEndpointEventResponse201") @@ -21,28 +21,22 @@ class CreateEndpointEventResponse201: Attributes: message (str | Unset): status (bool | Unset): - data (HandlersStubType0 | None | Unset): + data (ModelsEventQueuedResponse | Unset): """ message: str | Unset = UNSET status: bool | Unset = UNSET - data: HandlersStubType0 | None | Unset = UNSET + data: ModelsEventQueuedResponse | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.handlers_stub_type_0 import HandlersStubType0 - message = self.message status = self.status - data: dict[str, Any] | None | Unset - if isinstance(self.data, Unset): - data = UNSET - elif isinstance(self.data, HandlersStubType0): + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): data = self.data.to_dict() - else: - data = self.data field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,31 +52,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse d = dict(src_dict) message = d.pop("message", UNSET) status = d.pop("status", UNSET) - def _parse_data(data: object) -> HandlersStubType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - componentsschemashandlers_stub_type_0 = HandlersStubType0.from_dict( - data - ) - - return componentsschemashandlers_stub_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HandlersStubType0 | None | Unset, data) - - data = _parse_data(d.pop("data", UNSET)) + _data = d.pop("data", UNSET) + data: ModelsEventQueuedResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventQueuedResponse.from_dict(_data) create_endpoint_event_response_201 = cls( message=message, diff --git a/src/convoy/models/create_endpoint_fanout_event_response_201.py b/src/convoy/models/create_endpoint_fanout_event_response_201.py index b5174e9..a61b654 100644 --- a/src/convoy/models/create_endpoint_fanout_event_response_201.py +++ b/src/convoy/models/create_endpoint_fanout_event_response_201.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse T = TypeVar("T", bound="CreateEndpointFanoutEventResponse201") @@ -21,28 +21,22 @@ class CreateEndpointFanoutEventResponse201: Attributes: message (str | Unset): status (bool | Unset): - data (HandlersStubType0 | None | Unset): + data (ModelsEventQueuedResponse | Unset): """ message: str | Unset = UNSET status: bool | Unset = UNSET - data: HandlersStubType0 | None | Unset = UNSET + data: ModelsEventQueuedResponse | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.handlers_stub_type_0 import HandlersStubType0 - message = self.message status = self.status - data: dict[str, Any] | None | Unset - if isinstance(self.data, Unset): - data = UNSET - elif isinstance(self.data, HandlersStubType0): + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): data = self.data.to_dict() - else: - data = self.data field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -58,31 +52,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.handlers_stub_type_0 import HandlersStubType0 + from ..models.models_event_queued_response import ModelsEventQueuedResponse d = dict(src_dict) message = d.pop("message", UNSET) status = d.pop("status", UNSET) - def _parse_data(data: object) -> HandlersStubType0 | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - componentsschemashandlers_stub_type_0 = HandlersStubType0.from_dict( - data - ) - - return componentsschemashandlers_stub_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(HandlersStubType0 | None | Unset, data) - - data = _parse_data(d.pop("data", UNSET)) + _data = d.pop("data", UNSET) + data: ModelsEventQueuedResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventQueuedResponse.from_dict(_data) create_endpoint_fanout_event_response_201 = cls( message=message, diff --git a/src/convoy/models/models_event_queued_response.py b/src/convoy/models/models_event_queued_response.py new file mode 100644 index 0000000..ec984eb --- /dev/null +++ b/src/convoy/models/models_event_queued_response.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsEventQueuedResponse") + + +@_attrs_define +class ModelsEventQueuedResponse: + """ + Attributes: + event_type (str | Unset): + idempotency_key (str | Unset): + uid (str | Unset): UID is the event id. + """ + + event_type: str | Unset = UNSET + idempotency_key: str | Unset = UNSET + uid: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_type = self.event_type + + idempotency_key = self.idempotency_key + + uid = self.uid + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_type is not UNSET: + field_dict["event_type"] = event_type + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if uid is not UNSET: + field_dict["uid"] = uid + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_type = d.pop("event_type", UNSET) + + idempotency_key = d.pop("idempotency_key", UNSET) + + uid = d.pop("uid", UNSET) + + models_event_queued_response = cls( + event_type=event_type, + idempotency_key=idempotency_key, + uid=uid, + ) + + models_event_queued_response.additional_properties = d + return models_event_queued_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties