From d49ea01d3afdb029776c8f292207d2d39297e997 Mon Sep 17 00:00:00 2001 From: Rina Sergeeva Date: Fri, 6 Feb 2026 03:44:52 +0900 Subject: [PATCH] add `event_types` and `name` attributes to `WebhookEndpoint` resource --- lago_python_client/models/webhook_endpoint.py | 7 ++++++- tests/fixtures/webhook_endpoint.json | 2 ++ tests/fixtures/webhook_endpoint_index.json | 6 ++++++ tests/test_webhook_endpoint_client.py | 7 ++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lago_python_client/models/webhook_endpoint.py b/lago_python_client/models/webhook_endpoint.py index a97dd6ec..a948ef8d 100644 --- a/lago_python_client/models/webhook_endpoint.py +++ b/lago_python_client/models/webhook_endpoint.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import List, Optional from lago_python_client.base_model import BaseModel @@ -7,6 +7,9 @@ class WebhookEndpoint(BaseModel): webhook_url: Optional[str] + signature_algo: Optional[str] + name: Optional[str] + event_types: Optional[List[str]] class WebhookEndpointResponse(BaseResponseModel): @@ -14,4 +17,6 @@ class WebhookEndpointResponse(BaseResponseModel): lago_organization_id: str webhook_url: str signature_algo: Optional[str] + name: Optional[str] + event_types: Optional[List[str]] created_at: str diff --git a/tests/fixtures/webhook_endpoint.json b/tests/fixtures/webhook_endpoint.json index d944caf4..491bde39 100644 --- a/tests/fixtures/webhook_endpoint.json +++ b/tests/fixtures/webhook_endpoint.json @@ -4,6 +4,8 @@ "lago_organization_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", "webhook_url": "https://foo.bar", "signature_algo": "hmac", + "name": "My Webhook Endpoint", + "event_types": ["customer.created"], "created_at": "2022-04-29T08:59:51Z" } } diff --git a/tests/fixtures/webhook_endpoint_index.json b/tests/fixtures/webhook_endpoint_index.json index 3fa262ee..5e854006 100644 --- a/tests/fixtures/webhook_endpoint_index.json +++ b/tests/fixtures/webhook_endpoint_index.json @@ -4,12 +4,18 @@ "lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", "lago_organization_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", "webhook_url": "https://foo.bar", + "signature_algo": "hmac", + "name": null, + "event_types": null, "created_at": "2022-04-29T08:59:51Z" }, { "lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", "lago_organization_id": "b7ab2926-1de8-4428-9bcd-779314ac129b", "webhook_url": "https://foo.bar", + "signature_algo": "hmac", + "name": null, + "event_types": null, "created_at": "2022-04-29T08:59:51Z" } ], diff --git a/tests/test_webhook_endpoint_client.py b/tests/test_webhook_endpoint_client.py index f3092a4e..7e74af7f 100644 --- a/tests/test_webhook_endpoint_client.py +++ b/tests/test_webhook_endpoint_client.py @@ -9,7 +9,12 @@ def webhook_endpoint_object(): - return WebhookEndpoint(webhook_url="https://foo.bar", signature_algo="hmac") + return WebhookEndpoint( + webhook_url="https://foo.bar", + signature_algo="hmac", + name="My Webhook Endpoint", + event_types=["customer.created"], + ) def mock_response():