Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/convoy/api/event_deliveries/get_event_deliveries_paged.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,9 @@
from ...models.get_event_deliveries_paged_response_404 import (
GetEventDeliveriesPagedResponse404,
)
from ...models.get_event_deliveries_paged_response_504 import (
GetEventDeliveriesPagedResponse504,
)
from ...types import UNSET, Response, Unset


Expand DownExpand Up@@ -102,6 +105,7 @@ def _parse_response(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
| None
):
if response.status_code == 200:
Expand All@@ -124,6 +128,11 @@ def _parse_response(

return response_404

if response.status_code == 504:
response_504 = GetEventDeliveriesPagedResponse504.from_dict(response.json())

return response_504

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
Expand All@@ -137,6 +146,7 @@ def _build_response(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
]:
return Response(
status_code=HTTPStatus(response.status_code),
Expand DownExpand Up@@ -168,6 +178,7 @@ def sync_detailed(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
]:
"""List all event deliveries

Expand All@@ -194,7 +205,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404]
Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 | GetEventDeliveriesPagedResponse504]
"""

kwargs = _get_kwargs(
Expand DownExpand Up@@ -243,6 +254,7 @@ def sync(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
| None
):
"""List all event deliveries
Expand DownExpand Up@@ -270,7 +282,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404
GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 | GetEventDeliveriesPagedResponse504
"""

return sync_detailed(
Expand DownExpand Up@@ -314,6 +326,7 @@ async def asyncio_detailed(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
]:
"""List all event deliveries

Expand All@@ -340,7 +353,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404]
Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 | GetEventDeliveriesPagedResponse504]
"""

kwargs = _get_kwargs(
Expand DownExpand Up@@ -387,6 +400,7 @@ async def asyncio(
| GetEventDeliveriesPagedResponse400
| GetEventDeliveriesPagedResponse401
| GetEventDeliveriesPagedResponse404
| GetEventDeliveriesPagedResponse504
| None
):
"""List all event deliveries
Expand DownExpand Up@@ -414,7 +428,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404
GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 | GetEventDeliveriesPagedResponse504
"""

return (
Expand Down
2 changes: 2 additions & 0 deletions src/convoy/models/__init__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -244,6 +244,7 @@
from .get_event_deliveries_paged_response_400 import GetEventDeliveriesPagedResponse400
from .get_event_deliveries_paged_response_401 import GetEventDeliveriesPagedResponse401
from .get_event_deliveries_paged_response_404 import GetEventDeliveriesPagedResponse404
from .get_event_deliveries_paged_response_504 import GetEventDeliveriesPagedResponse504
from .get_event_delivery_response_200 import GetEventDeliveryResponse200
from .get_event_delivery_response_400 import GetEventDeliveryResponse400
from .get_event_delivery_response_401 import GetEventDeliveryResponse401
Expand DownExpand Up@@ -753,6 +754,7 @@
"GetEventDeliveriesPagedResponse400",
"GetEventDeliveriesPagedResponse401",
"GetEventDeliveriesPagedResponse404",
"GetEventDeliveriesPagedResponse504",
"GetEventDeliveryResponse200",
"GetEventDeliveryResponse400",
"GetEventDeliveryResponse401",
Expand Down
110 changes: 110 additions & 0 deletions src/convoy/models/get_event_deliveries_paged_response_504.py
Original file line numberDiff line numberDiff line change
@@ -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="GetEventDeliveriesPagedResponse504")


@_attrs_define
class GetEventDeliveriesPagedResponse504:
"""
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_event_deliveries_paged_response_504 = cls(
message=message,
status=status,
data=data,
)

get_event_deliveries_paged_response_504.additional_properties = d
return get_event_deliveries_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