-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathinterfaces.py
More file actions
33 lines (17 loc) · 1.19 KB
/
interfaces.py
File metadata and controls
33 lines (17 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Protocol interfaces for AWS Lambda Runtime Interface Client."""
from typing import Protocol, Any, Dict, Tuple, Optional, List
class RuntimeClientProtocol(Protocol):
"""Protocol for Lambda runtime client operations."""
marshaller: "MarshallerProtocol"
def wait_next_invocation(self) -> Any: ...
def post_invocation_result(self, invoke_id: Optional[str], result_data: Any, content_type: str = "application/json") -> None: ...
def post_invocation_error(self, invoke_id: Optional[str], error_response_data: str, xray_fault: str) -> None: ...
def post_init_error(self, error_response_data: Dict[str, Any], error_type_override: Optional[str] = None) -> None: ...
class MarshallerProtocol(Protocol):
"""Protocol for request/response marshalling."""
def unmarshal_request(self, request: Any, content_type: Optional[str] = "application/json") -> Any: ...
def marshal_response(self, response: Any) -> Tuple[Any, str]: ...
class LogSinkProtocol(Protocol):
"""Protocol for logging operations."""
def log(self, msg: str, frame_type: Optional[bytes] = None) -> None: ...
def log_error(self, message_lines: List[str]) -> None: ...