@@ -28,7 +28,7 @@ def __init__(
28
28
aws_account_id : str ,
29
29
api_id : str ,
30
30
stage : str ,
31
- http_method : str ,
31
+ http_method : str | None ,
32
32
resource : str ,
33
33
partition : str = "aws" ,
34
34
is_websocket_authorizer : bool = False ,
@@ -666,8 +666,9 @@ def from_route_arn(
666
666
usage_identifier_key ,
667
667
)
668
668
669
+ # Note: we need ignore[override] because we are removing the http_method field
669
670
@override
670
- def _add_route (self , effect : str , resource : str , conditions : list [dict ] | None = None ):
671
+ def _add_route (self , effect : str , resource : str , conditions : list [dict ] | None = None ): # type: ignore[override]
671
672
"""Adds a route to the internal lists of allowed or denied routes. Each object in
672
673
the internal list contains a resource ARN and a condition statement. The condition
673
674
statement can be null."""
@@ -700,8 +701,9 @@ def deny_all_routes(self):
700
701
701
702
self ._add_route (effect = "Deny" , resource = "*" )
702
703
704
+ # Note: we need ignore[override] because we are removing the http_method field
703
705
@override
704
- def allow_route (self , resource : str , conditions : list [dict ] | None = None ):
706
+ def allow_route (self , resource : str , conditions : list [dict ] | None = None ): # type: ignore[override]
705
707
"""
706
708
Add an API Gateway Websocket method to the list of allowed methods for the policy.
707
709
@@ -728,8 +730,9 @@ def allow_route(self, resource: str, conditions: list[dict] | None = None):
728
730
"""
729
731
self ._add_route (effect = "Allow" , resource = resource , conditions = conditions )
730
732
733
+ # Note: we need ignore[override] because we are removing the http_method field
731
734
@override
732
- def deny_route (self , resource : str , conditions : list [dict ] | None = None ):
735
+ def deny_route (self , resource : str , conditions : list [dict ] | None = None ): # type: ignore[override]
733
736
"""
734
737
Add an API Gateway Websocket method to the list of allowed methods for the policy.
735
738
0 commit comments