Repository navigation
Expand file tree
/
Copy pathfunction_metadata.py
More file actions
60 lines (52 loc) · 1.66 KB
/
Copy pathfunction_metadata.py
File metadata and controls
60 lines (52 loc) · 1.66 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, NamedTuple
if TYPE_CHECKING:
from pydantic import TypeAdapter
from ..core_definitions import (
IntersectDataHandler,
IntersectEncryptionScheme,
IntersectMimeType,
)
class FunctionMetadata(NamedTuple):
"""Internal cache of public function metadata.
NOTE: both this class and all properties in it should remain immutable after creation
"""
capability: type
"""
The type of the class that implements the target method.
"""
request_adapter: TypeAdapter[Any] | Literal[0] | None
"""
Type adapter for serializing and validating requests.
Null if user did not specify a request parameter.
0 if user did specify a request parameter, but Content-Type does not require a TypeAdapter.
"""
response_adapter: TypeAdapter[Any] | Literal[0]
"""
Type adapter for serializing and validating responses.
0 if Content-Type does not require a TypeAdapter.
"""
request_content_type: IntersectMimeType
"""
Content-Type of the request value
"""
response_content_type: IntersectMimeType
"""
Content-Type of the response value
"""
response_data_transfer_handler: IntersectDataHandler
"""
How we intend on handling the response value
"""
encryption_schemes: set[IntersectEncryptionScheme]
"""
Supported encryption schemes
"""
strict_validation: bool
"""
Whether or not we're using lenient Pydantic validation (default, False) or strict
"""
shutdown_keys: set[str]
"""
keys which should cause the function to be skipped if set
"""