|
46 | 46 | v1_endpoint_update,
|
47 | 47 | v1_endpoint_update_headers,
|
48 | 48 | )
|
| 49 | +from .internal.openapi_client.api.webhook_endpoint import ( |
| 50 | + create_operational_webhook_endpoint, |
| 51 | + delete_operational_webhook_endpoint, |
| 52 | + get_operational_webhook_endpoint, |
| 53 | + get_operational_webhook_endpoint_secret, |
| 54 | + list_operational_webhook_endpoints, |
| 55 | + rotate_operational_webhook_endpoint_secret, |
| 56 | + update_operational_webhook_endpoint, |
| 57 | +) |
49 | 58 | from .internal.openapi_client.api.event_type import (
|
50 | 59 | v1_event_type_create,
|
51 | 60 | v1_event_type_delete,
|
|
109 | 118 | from .internal.openapi_client.models.endpoint_secret_rotate_in import (
|
110 | 119 | EndpointSecretRotateIn,
|
111 | 120 | )
|
| 121 | +from .internal.openapi_client.models.operational_webhook_endpoint_in import ( |
| 122 | + OperationalWebhookEndpointIn, |
| 123 | +) |
| 124 | +from .internal.openapi_client.models.operational_webhook_endpoint_out import ( |
| 125 | + OperationalWebhookEndpointOut, |
| 126 | +) |
| 127 | +from .internal.openapi_client.models.operational_webhook_endpoint_secret_in import ( |
| 128 | + OperationalWebhookEndpointSecretIn, |
| 129 | +) |
| 130 | +from .internal.openapi_client.models.operational_webhook_endpoint_secret_out import ( |
| 131 | + OperationalWebhookEndpointSecretOut, |
| 132 | +) |
| 133 | +from .internal.openapi_client.models.operational_webhook_endpoint_update import ( |
| 134 | + OperationalWebhookEndpointUpdate, |
| 135 | +) |
112 | 136 | from .internal.openapi_client.models.endpoint_stats import EndpointStats
|
113 | 137 | from .internal.openapi_client.models.endpoint_transformation_in import (
|
114 | 138 | EndpointTransformationIn,
|
|
144 | 168 | from .internal.openapi_client.models.list_response_endpoint_out import (
|
145 | 169 | ListResponseEndpointOut,
|
146 | 170 | )
|
| 171 | +from .internal.openapi_client.models.list_response_operational_webhook_endpoint_out import ( |
| 172 | + ListResponseOperationalWebhookEndpointOut, |
| 173 | +) |
147 | 174 | from .internal.openapi_client.models.list_response_event_type_out import (
|
148 | 175 | ListResponseEventTypeOut,
|
149 | 176 | )
|
@@ -267,6 +294,11 @@ class EndpointStatsOptions:
|
267 | 294 | until: t.Optional[datetime] = None
|
268 | 295 |
|
269 | 296 |
|
| 297 | +@dataclass |
| 298 | +class OperationalWebhookEndpointListOptions(ListOptions): |
| 299 | + order: t.Optional[Ordering] = None |
| 300 | + |
| 301 | + |
270 | 302 | @dataclass
|
271 | 303 | class IntegrationListOptions(ListOptions):
|
272 | 304 | pass
|
@@ -1399,6 +1431,128 @@ def aggregate_event_types(self, task_id: str) -> AggregateEventTypesOut:
|
1399 | 1431 | return v1_statistics_aggregate_event_types.request_sync(client=self._client)
|
1400 | 1432 |
|
1401 | 1433 |
|
| 1434 | +class OperationalWebhookEndpointAsync(ApiBase): |
| 1435 | + async def list( |
| 1436 | + self, |
| 1437 | + options: OperationalWebhookEndpointListOptions = OperationalWebhookEndpointListOptions(), |
| 1438 | + ) -> ListResponseOperationalWebhookEndpointOut: |
| 1439 | + return await list_operational_webhook_endpoints.request_asyncio( |
| 1440 | + client=self._client, |
| 1441 | + **options.to_dict(), |
| 1442 | + ) |
| 1443 | + |
| 1444 | + async def create( |
| 1445 | + self, |
| 1446 | + endpoint_in: OperationalWebhookEndpointIn, |
| 1447 | + options: PostOptions = PostOptions(), |
| 1448 | + ) -> OperationalWebhookEndpointOut: |
| 1449 | + return await create_operational_webhook_endpoint.request_asyncio( |
| 1450 | + client=self._client, |
| 1451 | + json_body=endpoint_in, |
| 1452 | + **options.to_dict(), |
| 1453 | + ) |
| 1454 | + |
| 1455 | + async def get(self, endpoint_id: str) -> OperationalWebhookEndpointOut: |
| 1456 | + return await get_operational_webhook_endpoint.request_asyncio( |
| 1457 | + client=self._client, endpoint_id=endpoint_id |
| 1458 | + ) |
| 1459 | + |
| 1460 | + async def update( |
| 1461 | + self, endpoint_id: str, endpoint_update: OperationalWebhookEndpointUpdate |
| 1462 | + ) -> OperationalWebhookEndpointOut: |
| 1463 | + return await update_operational_webhook_endpoint.request_asyncio( |
| 1464 | + client=self._client, |
| 1465 | + endpoint_id=endpoint_id, |
| 1466 | + json_body=endpoint_update, |
| 1467 | + ) |
| 1468 | + |
| 1469 | + async def delete(self, endpoint_id: str) -> None: |
| 1470 | + return await delete_operational_webhook_endpoint.request_asyncio( |
| 1471 | + client=self._client, |
| 1472 | + endpoint_id=endpoint_id, |
| 1473 | + ) |
| 1474 | + |
| 1475 | + async def get_secret(self, endpoint_id: str) -> OperationalWebhookEndpointSecretOut: |
| 1476 | + return await get_operational_webhook_endpoint_secret.request_asyncio( |
| 1477 | + client=self._client, |
| 1478 | + endpoint_id=endpoint_id, |
| 1479 | + ) |
| 1480 | + |
| 1481 | + async def rotate_secret( |
| 1482 | + self, |
| 1483 | + endpoint_id: str, |
| 1484 | + endpoint_secret_rotate_in: OperationalWebhookEndpointSecretIn, |
| 1485 | + options: PostOptions = PostOptions(), |
| 1486 | + ) -> None: |
| 1487 | + return await rotate_operational_webhook_endpoint_secret.request_asyncio( |
| 1488 | + client=self._client, |
| 1489 | + endpoint_id=endpoint_id, |
| 1490 | + json_body=endpoint_secret_rotate_in, |
| 1491 | + **options.to_dict(), |
| 1492 | + ) |
| 1493 | + |
| 1494 | + |
| 1495 | +class OperationalWebhookEndpoint(ApiBase): |
| 1496 | + def list( |
| 1497 | + self, |
| 1498 | + options: OperationalWebhookEndpointListOptions = OperationalWebhookEndpointListOptions(), |
| 1499 | + ) -> ListResponseOperationalWebhookEndpointOut: |
| 1500 | + return list_operational_webhook_endpoints.request_sync( |
| 1501 | + client=self._client, |
| 1502 | + **options.to_dict(), |
| 1503 | + ) |
| 1504 | + |
| 1505 | + def create( |
| 1506 | + self, |
| 1507 | + endpoint_in: OperationalWebhookEndpointIn, |
| 1508 | + options: PostOptions = PostOptions(), |
| 1509 | + ) -> OperationalWebhookEndpointOut: |
| 1510 | + return create_operational_webhook_endpoint.request_sync( |
| 1511 | + client=self._client, |
| 1512 | + json_body=endpoint_in, |
| 1513 | + **options.to_dict(), |
| 1514 | + ) |
| 1515 | + |
| 1516 | + def get(self, endpoint_id: str) -> OperationalWebhookEndpointOut: |
| 1517 | + return get_operational_webhook_endpoint.request_sync( |
| 1518 | + client=self._client, endpoint_id=endpoint_id |
| 1519 | + ) |
| 1520 | + |
| 1521 | + def update( |
| 1522 | + self, endpoint_id: str, endpoint_update: OperationalWebhookEndpointUpdate |
| 1523 | + ) -> OperationalWebhookEndpointOut: |
| 1524 | + return update_operational_webhook_endpoint.request_sync( |
| 1525 | + client=self._client, |
| 1526 | + endpoint_id=endpoint_id, |
| 1527 | + json_body=endpoint_update, |
| 1528 | + ) |
| 1529 | + |
| 1530 | + def delete(self, endpoint_id: str) -> None: |
| 1531 | + return delete_operational_webhook_endpoint.request_sync( |
| 1532 | + client=self._client, |
| 1533 | + endpoint_id=endpoint_id, |
| 1534 | + ) |
| 1535 | + |
| 1536 | + def get_secret(self, endpoint_id: str) -> OperationalWebhookEndpointSecretOut: |
| 1537 | + return get_operational_webhook_endpoint_secret.request_sync( |
| 1538 | + client=self._client, |
| 1539 | + endpoint_id=endpoint_id, |
| 1540 | + ) |
| 1541 | + |
| 1542 | + def rotate_secret( |
| 1543 | + self, |
| 1544 | + endpoint_id: str, |
| 1545 | + endpoint_secret_rotate_in: OperationalWebhookEndpointSecretIn, |
| 1546 | + options: PostOptions = PostOptions(), |
| 1547 | + ) -> None: |
| 1548 | + return rotate_operational_webhook_endpoint_secret.request_sync( |
| 1549 | + client=self._client, |
| 1550 | + endpoint_id=endpoint_id, |
| 1551 | + json_body=endpoint_secret_rotate_in, |
| 1552 | + **options.to_dict(), |
| 1553 | + ) |
| 1554 | + |
| 1555 | + |
1402 | 1556 | class ClientBase:
|
1403 | 1557 | _client: AuthenticatedClient
|
1404 | 1558 |
|
@@ -1464,6 +1618,10 @@ def message_attempt(self) -> MessageAttemptAsync:
|
1464 | 1618 | def statistics(self) -> StatisticsAsync:
|
1465 | 1619 | return StatisticsAsync(self._client)
|
1466 | 1620 |
|
| 1621 | + @property |
| 1622 | + def operational_webhook_endpoint(self) -> OperationalWebhookEndpointAsync: |
| 1623 | + return OperationalWebhookEndpointAsync(self._client) |
| 1624 | + |
1467 | 1625 |
|
1468 | 1626 | class Svix(ClientBase):
|
1469 | 1627 | @property
|
@@ -1498,6 +1656,10 @@ def message_attempt(self) -> MessageAttempt:
|
1498 | 1656 | def statistics(self) -> Statistics:
|
1499 | 1657 | return Statistics(self._client)
|
1500 | 1658 |
|
| 1659 | + @property |
| 1660 | + def operational_webhook_endpoint(self) -> OperationalWebhookEndpointAsync: |
| 1661 | + return OperationalWebhookEndpointAsync(self._client) |
| 1662 | + |
1501 | 1663 |
|
1502 | 1664 | __all__ = [
|
1503 | 1665 | "ApplicationIn",
|
|
0 commit comments