Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-48838: Convert more enums to StrEnum #376

Merged
merged 1 commit into from
Feb 11, 2025
Merged
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
12 changes: 6 additions & 6 deletions safir/src/safir/github/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from enum import Enum
from enum import StrEnum

from pydantic import BaseModel, Field

Expand Down Expand Up @@ -93,7 +93,7 @@ def owner_name(self) -> str:
return self.full_name.split("/")[0]


class GitHubAppInstallationEventAction(str, Enum):
class GitHubAppInstallationEventAction(StrEnum):
"""The action performed on an GitHub App ``installation`` webhook
(`GitHubAppInstallationEventModel`).
"""
Expand Down Expand Up @@ -135,7 +135,7 @@ class GitHubAppInstallationEventModel(BaseModel):
)


class GitHubAppInstallationRepositoriesEventAction(str, Enum):
class GitHubAppInstallationRepositoriesEventAction(StrEnum):
"""The action performed on a GitHub App ``installation_repositories``
webhook (`GitHubAppInstallationRepositoriesEventModel`).
"""
Expand Down Expand Up @@ -170,7 +170,7 @@ class GitHubAppInstallationRepositoriesEventModel(BaseModel):
)


class GitHubPullRequestEventAction(str, Enum):
class GitHubPullRequestEventAction(StrEnum):
"""The action performed on a GitHub ``pull_request`` webhook
(`GitHubPullRequestEventModel`).
"""
Expand Down Expand Up @@ -266,7 +266,7 @@ class GitHubPullRequestEventModel(BaseModel):
)


class GitHubCheckSuiteEventAction(str, Enum):
class GitHubCheckSuiteEventAction(StrEnum):
"""The action performed in a GitHub ``check_suite`` webhook
(`GitHubCheckSuiteEventModel`).
"""
Expand Down Expand Up @@ -306,7 +306,7 @@ class GitHubCheckSuiteEventModel(BaseModel):
)


class GitHubCheckRunEventAction(str, Enum):
class GitHubCheckRunEventAction(StrEnum):
"""The action performed in a GitHub ``check_run`` webhook
(`GitHubCheckRunEventModel`).
"""
Expand Down