File tree Expand file tree Collapse file tree 11 files changed +68
-16
lines changed
nonebot/adapters/github/event Expand file tree Collapse file tree 11 files changed +68
-16
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ from typing import Union
22from functools import cached_property
33from typing_extensions import override
44
5+ from nonebot.compat import PYDANTIC_V2, ConfigDict
56{% for model in action .payload_types %}
67from githubkit.versions.latest.models import {{ model }}
78{% endfor %}
@@ -32,7 +33,10 @@ class {{ action.class_name }}(Event):
3233 def get_message(self):
3334 return self._message
3435
35- class Config:
36- keep_untouched = (cached_property,)
36+ if PYDANTIC_V2:
37+ model_config = ConfigDict(ignored_types=(cached_property,))
38+ else:
39+ class Config:
40+ keep_untouched = (cached_property,)
3741
3842 {% endif %}
Original file line number Diff line number Diff line change 343343 from .dependabot_alert_auto_dismissed import (
344344 DependabotAlertAutoDismissed as DependabotAlertAutoDismissed ,
345345 )
346+ from .secret_scanning_alert_validated import (
347+ SecretScanningAlertValidated as SecretScanningAlertValidated ,
348+ )
346349 from .sponsorship_pending_tier_change import (
347350 SponsorshipPendingTierChange as SponsorshipPendingTierChange ,
348351 )
674677 ".secret_scanning_alert_reopened" : ("SecretScanningAlertReopened" ,),
675678 ".secret_scanning_alert_resolved" : ("SecretScanningAlertResolved" ,),
676679 ".secret_scanning_alert_revoked" : ("SecretScanningAlertRevoked" ,),
680+ ".secret_scanning_alert_validated" : ("SecretScanningAlertValidated" ,),
677681 ".secret_scanning_alert_location" : ("SecretScanningAlertLocationCreated" ,),
678682 ".security_advisory_published" : ("SecurityAdvisoryPublished" ,),
679683 ".security_advisory_updated" : ("SecurityAdvisoryUpdated" ,),
Original file line number Diff line number Diff line change 294294 "reopened" : "SecretScanningAlertReopened" ,
295295 "resolved" : "SecretScanningAlertResolved" ,
296296 "revoked" : "SecretScanningAlertRevoked" ,
297+ "validated" : "SecretScanningAlertValidated" ,
297298 },
298299 "secret_scanning_alert_location" : "SecretScanningAlertLocationCreated" ,
299300 "security_advisory" : {
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookCommitCommentCreated
56
67from ._base import Event
@@ -23,5 +24,9 @@ def _message(self):
2324 def get_message (self ):
2425 return self ._message
2526
26- class Config :
27- keep_untouched = (cached_property ,)
27+ if PYDANTIC_V2 :
28+ model_config = ConfigDict (ignored_types = (cached_property ,))
29+ else :
30+
31+ class Config :
32+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookIssueCommentCreated
56
67from ._base import Event
@@ -23,5 +24,9 @@ def _message(self):
2324 def get_message (self ):
2425 return self ._message
2526
26- class Config :
27- keep_untouched = (cached_property ,)
27+ if PYDANTIC_V2 :
28+ model_config = ConfigDict (ignored_types = (cached_property ,))
29+ else :
30+
31+ class Config :
32+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookIssueCommentDeleted
56
67from ._base import Event
@@ -19,5 +20,9 @@ def _message(self):
1920 def get_message (self ):
2021 return self ._message
2122
22- class Config :
23- keep_untouched = (cached_property ,)
23+ if PYDANTIC_V2 :
24+ model_config = ConfigDict (ignored_types = (cached_property ,))
25+ else :
26+
27+ class Config :
28+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookIssueCommentEdited
56
67from ._base import Event
@@ -19,5 +20,9 @@ def _message(self):
1920 def get_message (self ):
2021 return self ._message
2122
22- class Config :
23- keep_untouched = (cached_property ,)
23+ if PYDANTIC_V2 :
24+ model_config = ConfigDict (ignored_types = (cached_property ,))
25+ else :
26+
27+ class Config :
28+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookPullRequestReviewCommentCreated
56
67from ._base import Event
@@ -23,5 +24,9 @@ def _message(self):
2324 def get_message (self ):
2425 return self ._message
2526
26- class Config :
27- keep_untouched = (cached_property ,)
27+ if PYDANTIC_V2 :
28+ model_config = ConfigDict (ignored_types = (cached_property ,))
29+ else :
30+
31+ class Config :
32+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookPullRequestReviewCommentDeleted
56
67from ._base import Event
@@ -19,5 +20,9 @@ def _message(self):
1920 def get_message (self ):
2021 return self ._message
2122
22- class Config :
23- keep_untouched = (cached_property ,)
23+ if PYDANTIC_V2 :
24+ model_config = ConfigDict (ignored_types = (cached_property ,))
25+ else :
26+
27+ class Config :
28+ keep_untouched = (cached_property ,)
Original file line number Diff line number Diff line change 11from functools import cached_property
22from typing_extensions import override
33
4+ from nonebot .compat import PYDANTIC_V2 , ConfigDict
45from githubkit .versions .latest .models import WebhookPullRequestReviewCommentEdited
56
67from ._base import Event
@@ -19,5 +20,9 @@ def _message(self):
1920 def get_message (self ):
2021 return self ._message
2122
22- class Config :
23- keep_untouched = (cached_property ,)
23+ if PYDANTIC_V2 :
24+ model_config = ConfigDict (ignored_types = (cached_property ,))
25+ else :
26+
27+ class Config :
28+ keep_untouched = (cached_property ,)
You can’t perform that action at this time.
0 commit comments