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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ ignore = [
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"W191", # Indentation contains tabs
"UP037", # Remove quotes from type annotation
]

[tool.ruff.lint.per-file-ignores]
Expand Down
14 changes: 13 additions & 1 deletion replicate/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@


class WebhookSigningSecret(Resource):
"""
A webhook signing secret.
"""

key: str


Expand Down Expand Up @@ -43,6 +47,10 @@ class InvalidSignatureError(WebhookValidationError):


class Webhooks(Namespace):
"""
Namespace for operations related to webhooks.
"""

@property
def default(self) -> "Webhooks.Default":
"""
Expand All @@ -52,6 +60,10 @@ def default(self) -> "Webhooks.Default":
return self.Default(self._client)

class Default(Namespace):
"""
Namespace for operations related to the default webhook.
"""

def secret(self) -> WebhookSigningSecret:
"""
Get the default webhook signing secret.
Expand Down Expand Up @@ -94,7 +106,7 @@ def validate(
) -> bool: ...

@staticmethod
def validate( # type: ignore
def validate( # type: ignore # pylint: disable=too-many-branches,too-many-locals
request: Optional["httpx.Request"] = None,
headers: Optional[Dict[str, str]] = None,
body: Optional[str] = None,
Expand Down