Skip to content
Open
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
7 changes: 6 additions & 1 deletion lago_python_client/models/webhook_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import List, Optional

from lago_python_client.base_model import BaseModel

Expand All @@ -7,11 +7,16 @@

class WebhookEndpoint(BaseModel):
webhook_url: Optional[str]
signature_algo: Optional[str]
name: Optional[str]
event_types: Optional[List[str]]


class WebhookEndpointResponse(BaseResponseModel):
lago_id: str
lago_organization_id: str
webhook_url: str
signature_algo: Optional[str]
name: Optional[str]
event_types: Optional[List[str]]
created_at: str
2 changes: 2 additions & 0 deletions tests/fixtures/webhook_endpoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 6 additions & 0 deletions tests/fixtures/webhook_endpoint_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
],
Expand Down
7 changes: 6 additions & 1 deletion tests/test_webhook_endpoint_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down