diff --git a/src/convoy/api/events/batch_replay_events.py b/src/convoy/api/events/batch_replay_events.py index b20e2ef..40b291e 100644 --- a/src/convoy/api/events/batch_replay_events.py +++ b/src/convoy/api/events/batch_replay_events.py @@ -17,6 +17,7 @@ def _get_kwargs( project_id: str, *, + body: str | Unset = UNSET, direction: BatchReplayEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -32,6 +33,8 @@ def _get_kwargs( params: dict[str, Any] = {} + params["body"] = body + json_direction: str | Unset = UNSET if not isinstance(direction, Unset): json_direction = direction.value @@ -134,6 +137,7 @@ def sync_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: BatchReplayEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -157,6 +161,7 @@ def sync_detailed( Args: project_id (str): + body (str | Unset): direction (BatchReplayEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -179,6 +184,7 @@ def sync_detailed( kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -203,6 +209,7 @@ def sync( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: BatchReplayEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -227,6 +234,7 @@ def sync( Args: project_id (str): + body (str | Unset): direction (BatchReplayEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -250,6 +258,7 @@ def sync( return sync_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -268,6 +277,7 @@ async def asyncio_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: BatchReplayEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -291,6 +301,7 @@ async def asyncio_detailed( Args: project_id (str): + body (str | Unset): direction (BatchReplayEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -313,6 +324,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -335,6 +347,7 @@ async def asyncio( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: BatchReplayEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -359,6 +372,7 @@ async def asyncio( Args: project_id (str): + body (str | Unset): direction (BatchReplayEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -383,6 +397,7 @@ async def asyncio( await asyncio_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, diff --git a/src/convoy/api/events/count_affected_events.py b/src/convoy/api/events/count_affected_events.py index 1410684..3f060c3 100644 --- a/src/convoy/api/events/count_affected_events.py +++ b/src/convoy/api/events/count_affected_events.py @@ -17,6 +17,7 @@ def _get_kwargs( project_id: str, *, + body: str | Unset = UNSET, direction: CountAffectedEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -32,6 +33,8 @@ def _get_kwargs( params: dict[str, Any] = {} + params["body"] = body + json_direction: str | Unset = UNSET if not isinstance(direction, Unset): json_direction = direction.value @@ -134,6 +137,7 @@ def sync_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: CountAffectedEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -157,6 +161,7 @@ def sync_detailed( Args: project_id (str): + body (str | Unset): direction (CountAffectedEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -179,6 +184,7 @@ def sync_detailed( kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -203,6 +209,7 @@ def sync( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: CountAffectedEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -227,6 +234,7 @@ def sync( Args: project_id (str): + body (str | Unset): direction (CountAffectedEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -250,6 +258,7 @@ def sync( return sync_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -268,6 +277,7 @@ async def asyncio_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: CountAffectedEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -291,6 +301,7 @@ async def asyncio_detailed( Args: project_id (str): + body (str | Unset): direction (CountAffectedEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -313,6 +324,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -335,6 +347,7 @@ async def asyncio( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: CountAffectedEventsDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -359,6 +372,7 @@ async def asyncio( Args: project_id (str): + body (str | Unset): direction (CountAffectedEventsDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -383,6 +397,7 @@ async def asyncio( await asyncio_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, diff --git a/src/convoy/api/events/get_events_paged.py b/src/convoy/api/events/get_events_paged.py index 82db4f9..8d98242 100644 --- a/src/convoy/api/events/get_events_paged.py +++ b/src/convoy/api/events/get_events_paged.py @@ -10,13 +10,16 @@ from ...models.get_events_paged_response_200 import GetEventsPagedResponse200 from ...models.get_events_paged_response_400 import GetEventsPagedResponse400 from ...models.get_events_paged_response_401 import GetEventsPagedResponse401 +from ...models.get_events_paged_response_403 import GetEventsPagedResponse403 from ...models.get_events_paged_response_404 import GetEventsPagedResponse404 +from ...models.get_events_paged_response_504 import GetEventsPagedResponse504 from ...types import UNSET, Response, Unset def _get_kwargs( project_id: str, *, + body: str | Unset = UNSET, direction: GetEventsPagedDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -32,6 +35,8 @@ def _get_kwargs( params: dict[str, Any] = {} + params["body"] = body + json_direction: str | Unset = UNSET if not isinstance(direction, Unset): json_direction = direction.value @@ -85,7 +90,9 @@ def _parse_response( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 | None ): if response.status_code == 200: @@ -103,11 +110,21 @@ def _parse_response( return response_401 + if response.status_code == 403: + response_403 = GetEventsPagedResponse403.from_dict(response.json()) + + return response_403 + if response.status_code == 404: response_404 = GetEventsPagedResponse404.from_dict(response.json()) return response_404 + if response.status_code == 504: + response_504 = GetEventsPagedResponse504.from_dict(response.json()) + + return response_504 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -120,7 +137,9 @@ def _build_response( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 ]: return Response( status_code=HTTPStatus(response.status_code), @@ -134,6 +153,7 @@ def sync_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: GetEventsPagedDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -149,7 +169,9 @@ def sync_detailed( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 ]: """List all events @@ -157,6 +179,7 @@ def sync_detailed( Args: project_id (str): + body (str | Unset): direction (GetEventsPagedDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -174,11 +197,12 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404] + Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse403 | GetEventsPagedResponse404 | GetEventsPagedResponse504] """ kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -203,6 +227,7 @@ def sync( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: GetEventsPagedDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -218,7 +243,9 @@ def sync( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 | None ): """List all events @@ -227,6 +254,7 @@ def sync( Args: project_id (str): + body (str | Unset): direction (GetEventsPagedDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -244,12 +272,13 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404 + GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse403 | GetEventsPagedResponse404 | GetEventsPagedResponse504 """ return sync_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -268,6 +297,7 @@ async def asyncio_detailed( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: GetEventsPagedDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -283,7 +313,9 @@ async def asyncio_detailed( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 ]: """List all events @@ -291,6 +323,7 @@ async def asyncio_detailed( Args: project_id (str): + body (str | Unset): direction (GetEventsPagedDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -308,11 +341,12 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404] + Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse403 | GetEventsPagedResponse404 | GetEventsPagedResponse504] """ kwargs = _get_kwargs( project_id=project_id, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, @@ -335,6 +369,7 @@ async def asyncio( project_id: str, *, client: AuthenticatedClient, + body: str | Unset = UNSET, direction: GetEventsPagedDirection | Unset = UNSET, end_date: str | Unset = UNSET, endpoint_id: list[str] | Unset = UNSET, @@ -350,7 +385,9 @@ async def asyncio( GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 + | GetEventsPagedResponse403 | GetEventsPagedResponse404 + | GetEventsPagedResponse504 | None ): """List all events @@ -359,6 +396,7 @@ async def asyncio( Args: project_id (str): + body (str | Unset): direction (GetEventsPagedDirection | Unset): end_date (str | Unset): endpoint_id (list[str] | Unset): @@ -376,13 +414,14 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404 + GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse403 | GetEventsPagedResponse404 | GetEventsPagedResponse504 """ return ( await asyncio_detailed( project_id=project_id, client=client, + body=body, direction=direction, end_date=end_date, endpoint_id=endpoint_id, diff --git a/src/convoy/models/__init__.py b/src/convoy/models/__init__.py index 45d5391..9f6e651 100644 --- a/src/convoy/models/__init__.py +++ b/src/convoy/models/__init__.py @@ -257,7 +257,9 @@ from .get_events_paged_response_200_data import GetEventsPagedResponse200Data from .get_events_paged_response_400 import GetEventsPagedResponse400 from .get_events_paged_response_401 import GetEventsPagedResponse401 +from .get_events_paged_response_403 import GetEventsPagedResponse403 from .get_events_paged_response_404 import GetEventsPagedResponse404 +from .get_events_paged_response_504 import GetEventsPagedResponse504 from .get_filter_response_200 import GetFilterResponse200 from .get_filter_response_400 import GetFilterResponse400 from .get_filter_response_401 import GetFilterResponse401 @@ -760,7 +762,9 @@ "GetEventsPagedResponse200Data", "GetEventsPagedResponse400", "GetEventsPagedResponse401", + "GetEventsPagedResponse403", "GetEventsPagedResponse404", + "GetEventsPagedResponse504", "GetEventTypesResponse200", "GetEventTypesResponse400", "GetEventTypesResponse401", diff --git a/src/convoy/models/datastore_project_config.py b/src/convoy/models/datastore_project_config.py index 5e82386..72fc963 100644 --- a/src/convoy/models/datastore_project_config.py +++ b/src/convoy/models/datastore_project_config.py @@ -46,7 +46,9 @@ class DatastoreProjectConfig: ratelimit (DatastoreRateLimitConfiguration | None | Unset): replay_attacks_prevention_enabled (bool | Unset): request_id_header (ConfigRequestIDHeaderProvider | Unset): - search_policy (str | Unset): + search_policy (str | Unset): SearchPolicy is an optional Go duration (e.g. "24h") shown in project settings. + When set, the dashboard explains that payload/JSON search is additionally clamped + to this lookback intersected with the Events log date picker. Empty means opt-out. signature (DatastoreSignatureConfiguration | None | Unset): ssl (DatastoreSSLConfiguration | None | Unset): strategy (DatastoreStrategyConfiguration | None | Unset): diff --git a/src/convoy/models/get_events_paged_response_403.py b/src/convoy/models/get_events_paged_response_403.py new file mode 100644 index 0000000..f94f3d2 --- /dev/null +++ b/src/convoy/models/get_events_paged_response_403.py @@ -0,0 +1,110 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub_type_0 import HandlersStubType0 + + +T = TypeVar("T", bound="GetEventsPagedResponse403") + + +@_attrs_define +class GetEventsPagedResponse403: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStubType0 | None | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStubType0 | None | 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 = self.data.to_dict() + else: + data = self.data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub_type_0 import HandlersStubType0 + + 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)) + + get_events_paged_response_403 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_403.additional_properties = d + return get_events_paged_response_403 + + @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 diff --git a/src/convoy/models/get_events_paged_response_504.py b/src/convoy/models/get_events_paged_response_504.py new file mode 100644 index 0000000..096531f --- /dev/null +++ b/src/convoy/models/get_events_paged_response_504.py @@ -0,0 +1,110 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub_type_0 import HandlersStubType0 + + +T = TypeVar("T", bound="GetEventsPagedResponse504") + + +@_attrs_define +class GetEventsPagedResponse504: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStubType0 | None | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStubType0 | None | 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 = self.data.to_dict() + else: + data = self.data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub_type_0 import HandlersStubType0 + + 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)) + + get_events_paged_response_504 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_504.additional_properties = d + return get_events_paged_response_504 + + @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