botocore-stubs 1.34.66__py3-none-any.whl → 1.35.99__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of botocore-stubs might be problematic. Click here for more details.

Files changed (72) hide show
  1. botocore-stubs/__init__.pyi +8 -2
  2. botocore-stubs/args.pyi +27 -26
  3. botocore-stubs/auth.pyi +38 -29
  4. botocore-stubs/awsrequest.pyi +29 -23
  5. botocore-stubs/client.pyi +44 -35
  6. botocore-stubs/compat.pyi +23 -13
  7. botocore-stubs/compress.pyi +8 -3
  8. botocore-stubs/config.pyi +29 -29
  9. botocore-stubs/configloader.pyi +11 -5
  10. botocore-stubs/configprovider.pyi +40 -28
  11. botocore-stubs/credentials.pyi +105 -93
  12. botocore-stubs/crt/__init__.pyi +6 -2
  13. botocore-stubs/crt/auth.pyi +6 -2
  14. botocore-stubs/discovery.pyi +30 -14
  15. botocore-stubs/docs/__init__.pyi +6 -2
  16. botocore-stubs/docs/bcdoc/__init__.pyi +6 -0
  17. botocore-stubs/docs/bcdoc/docstringparser.pyi +13 -7
  18. botocore-stubs/docs/bcdoc/restdoc.pyi +27 -17
  19. botocore-stubs/docs/bcdoc/style.pyi +13 -7
  20. botocore-stubs/docs/client.pyi +10 -4
  21. botocore-stubs/docs/docstring.pyi +6 -2
  22. botocore-stubs/docs/example.pyi +34 -25
  23. botocore-stubs/docs/method.pyi +23 -16
  24. botocore-stubs/docs/paginator.pyi +9 -2
  25. botocore-stubs/docs/params.pyi +31 -22
  26. botocore-stubs/docs/service.pyi +14 -9
  27. botocore-stubs/docs/shape.pyi +11 -4
  28. botocore-stubs/docs/sharedexample.pyi +19 -5
  29. botocore-stubs/docs/translator.pyi +8 -2
  30. botocore-stubs/docs/utils.pyi +15 -10
  31. botocore-stubs/docs/waiter.pyi +8 -3
  32. botocore-stubs/endpoint.pyi +24 -14
  33. botocore-stubs/endpoint_provider.pyi +41 -40
  34. botocore-stubs/errorfactory.pyi +9 -3
  35. botocore-stubs/eventstream.pyi +22 -16
  36. botocore-stubs/exceptions.pyi +10 -10
  37. botocore-stubs/handlers.pyi +36 -14
  38. botocore-stubs/history.pyi +8 -2
  39. botocore-stubs/hooks.pyi +28 -22
  40. botocore-stubs/httpchecksum.pyi +15 -10
  41. botocore-stubs/httpsession.pyi +23 -17
  42. botocore-stubs/loaders.pyi +19 -13
  43. botocore-stubs/model.pyi +60 -44
  44. botocore-stubs/monitoring.pyi +29 -22
  45. botocore-stubs/paginate.pyi +38 -24
  46. botocore-stubs/parsers.pyi +13 -7
  47. botocore-stubs/regions.pyi +38 -29
  48. botocore-stubs/response.pyi +10 -4
  49. botocore-stubs/retries/adaptive.pyi +7 -1
  50. botocore-stubs/retries/base.pyi +9 -3
  51. botocore-stubs/retries/bucket.pyi +13 -9
  52. botocore-stubs/retries/quota.pyi +11 -5
  53. botocore-stubs/retries/special.pyi +9 -2
  54. botocore-stubs/retries/standard.pyi +32 -24
  55. botocore-stubs/retries/throttling.pyi +6 -0
  56. botocore-stubs/retryhandler.pyi +12 -6
  57. botocore-stubs/serialize.pyi +14 -8
  58. botocore-stubs/session.pyi +53 -55
  59. botocore-stubs/signers.pyi +40 -23
  60. botocore-stubs/stub.pyi +15 -15
  61. botocore-stubs/tokens.pyi +12 -6
  62. botocore-stubs/translate.pyi +12 -5
  63. botocore-stubs/useragent.pyi +11 -5
  64. botocore-stubs/utils.pyi +86 -76
  65. botocore-stubs/validate.pyi +7 -1
  66. botocore-stubs/waiter.pyi +11 -5
  67. {botocore_stubs-1.34.66.dist-info → botocore_stubs-1.35.99.dist-info}/METADATA +39 -20
  68. botocore_stubs-1.35.99.dist-info/RECORD +73 -0
  69. {botocore_stubs-1.34.66.dist-info → botocore_stubs-1.35.99.dist-info}/WHEEL +2 -1
  70. botocore_stubs-1.35.99.dist-info/top_level.txt +1 -0
  71. botocore_stubs-1.34.66.dist-info/RECORD +0 -72
  72. {botocore_stubs-1.34.66.dist-info → botocore_stubs-1.35.99.dist-info}/LICENSE +0 -0
@@ -1,9 +1,15 @@
1
+ """
2
+ Type annotations for botocore.history module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Optional
8
+ from typing import Any
3
9
 
4
10
  logger: Logger = ...
5
11
 
6
- HISTORY_RECORDER: Optional[HistoryRecorder]
12
+ HISTORY_RECORDER: HistoryRecorder | None
7
13
 
8
14
  class BaseHistoryHandler:
9
15
  def emit(self, event_type: str, payload: Any, source: str) -> None: ...
botocore-stubs/hooks.pyi CHANGED
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for botocore.hooks module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, NamedTuple, Optional, TypeVar
8
+ from typing import Any, Callable, Mapping, NamedTuple, TypeVar
3
9
 
4
10
  from botocore.compat import accepts_kwargs as accepts_kwargs
5
11
  from botocore.utils import EVENT_ALIASES as EVENT_ALIASES
@@ -16,36 +22,36 @@ class _NodeList(NamedTuple):
16
22
  class NodeList(_NodeList):
17
23
  def __copy__(self: _R) -> _R: ...
18
24
 
19
- def first_non_none_response(responses: Any, default: Optional[Any] = ...) -> Any: ...
25
+ def first_non_none_response(responses: Any, default: Any | None = ...) -> Any: ...
20
26
 
21
27
  class BaseEventHooks:
22
- def emit(self, event_name: Any, **kwargs: Any) -> Any: ...
28
+ def emit(self, event_name: str, **kwargs: Any) -> Any: ...
23
29
  def register(
24
30
  self,
25
31
  event_name: str,
26
- handler: Any,
27
- unique_id: Optional[str] = ...,
32
+ handler: Callable[..., None],
33
+ unique_id: str | None = ...,
28
34
  unique_id_uses_count: bool = ...,
29
35
  ) -> None: ...
30
36
  def register_first(
31
37
  self,
32
38
  event_name: str,
33
- handler: Any,
34
- unique_id: Optional[str] = ...,
39
+ handler: Callable[..., None],
40
+ unique_id: str | None = ...,
35
41
  unique_id_uses_count: bool = ...,
36
42
  ) -> None: ...
37
43
  def register_last(
38
44
  self,
39
45
  event_name: str,
40
- handler: Any,
41
- unique_id: Optional[str] = ...,
46
+ handler: Callable[..., None],
47
+ unique_id: str | None = ...,
42
48
  unique_id_uses_count: bool = ...,
43
49
  ) -> None: ...
44
50
  def unregister(
45
51
  self,
46
52
  event_name: str,
47
- handler: Optional[Any] = ...,
48
- unique_id: Optional[str] = ...,
53
+ handler: Callable[..., None] | None = ...,
54
+ unique_id: str | None = ...,
49
55
  unique_id_uses_count: bool = ...,
50
56
  ) -> None: ...
51
57
 
@@ -56,44 +62,44 @@ class HierarchicalEmitter(BaseEventHooks):
56
62
  def unregister(
57
63
  self,
58
64
  event_name: str,
59
- handler: Optional[Any] = ...,
60
- unique_id: Optional[str] = ...,
65
+ handler: Callable[..., None] | None = ...,
66
+ unique_id: str | None = ...,
61
67
  unique_id_uses_count: bool = ...,
62
68
  ) -> None: ...
63
69
  def __copy__(self: _R) -> _R: ...
64
70
 
65
71
  class EventAliaser(BaseEventHooks):
66
72
  def __init__(
67
- self, event_emitter: BaseEventHooks, event_aliases: Optional[Any] = ...
73
+ self, event_emitter: BaseEventHooks, event_aliases: Mapping[str, str] | None = ...
68
74
  ) -> None: ...
69
75
  def emit(self, event_name: str, **kwargs: Any) -> Any: ...
70
76
  def emit_until_response(self, event_name: str, **kwargs: Any) -> Any: ...
71
77
  def register(
72
78
  self,
73
79
  event_name: str,
74
- handler: Any,
75
- unique_id: Optional[Any] = ...,
80
+ handler: Callable[..., None],
81
+ unique_id: str | None = ...,
76
82
  unique_id_uses_count: bool = ...,
77
83
  ) -> Any: ...
78
84
  def register_first(
79
85
  self,
80
86
  event_name: str,
81
- handler: Any,
82
- unique_id: Optional[str] = ...,
87
+ handler: Callable[..., None],
88
+ unique_id: str | None = ...,
83
89
  unique_id_uses_count: bool = ...,
84
90
  ) -> Any: ...
85
91
  def register_last(
86
92
  self,
87
93
  event_name: str,
88
- handler: Any,
89
- unique_id: Optional[str] = ...,
94
+ handler: Callable[..., None],
95
+ unique_id: str | None = ...,
90
96
  unique_id_uses_count: bool = ...,
91
97
  ) -> Any: ...
92
98
  def unregister(
93
99
  self,
94
100
  event_name: str,
95
- handler: Optional[Any] = ...,
96
- unique_id: Optional[str] = ...,
101
+ handler: Callable[..., None] | None = ...,
102
+ unique_id: str | None = ...,
97
103
  unique_id_uses_count: bool = ...,
98
104
  ) -> Any: ...
99
105
  def __copy__(self: _R) -> _R: ...
@@ -1,7 +1,12 @@
1
+ """
2
+ Type annotations for botocore.httpchecksum module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
- from typing import IO, Any, Dict, Iterator, Mapping, Optional, Sequence, Type, Union
8
+ from typing import IO, Any, Iterator, Mapping, Sequence
3
9
 
4
- from awscrt import checksums as crt_checksums
5
10
  from botocore.awsrequest import AWSHTTPResponse
6
11
  from botocore.compat import HAS_CRT as HAS_CRT
7
12
  from botocore.exceptions import AwsChunkedWrapperError as AwsChunkedWrapperError
@@ -14,10 +19,10 @@ from botocore.utils import determine_content_length as determine_content_length
14
19
  logger: logging.Logger
15
20
 
16
21
  class BaseChecksum:
17
- def update(self, chunk: Union[bytes, bytearray]) -> None: ...
22
+ def update(self, chunk: bytes | bytearray) -> None: ...
18
23
  def digest(self) -> bytes: ...
19
24
  def b64digest(self) -> str: ...
20
- def handle(self, body: Union[bytes, bytearray, IO[Any]]) -> str: ...
25
+ def handle(self, body: bytes | bytearray | IO[Any]) -> str: ...
21
26
 
22
27
  class Crc32Checksum(BaseChecksum):
23
28
  def __init__(self) -> None: ...
@@ -38,19 +43,19 @@ class AwsChunkedWrapper:
38
43
  def __init__(
39
44
  self,
40
45
  raw: IO[Any],
41
- checksum_cls: Optional[Type[BaseChecksum]] = ...,
46
+ checksum_cls: type[BaseChecksum] | None = ...,
42
47
  checksum_name: str = ...,
43
- chunk_size: Optional[int] = ...,
48
+ chunk_size: int | None = ...,
44
49
  ) -> None: ...
45
50
  def seek(self, offset: int, whence: int = ...) -> None: ...
46
- def read(self, size: Optional[int] = ...) -> bytes: ...
51
+ def read(self, size: int | None = ...) -> bytes: ...
47
52
  def __iter__(self) -> Iterator[bytes]: ...
48
53
 
49
54
  class StreamingChecksumBody(StreamingBody):
50
55
  def __init__(
51
56
  self, raw_stream: IO[Any], content_length: int, checksum: BaseChecksum, expected: str
52
57
  ) -> None: ...
53
- def read(self, amt: Optional[int] = ...) -> bytes: ...
58
+ def read(self, amt: int | None = ...) -> bytes: ...
54
59
 
55
60
  def resolve_checksum_context(
56
61
  request: Mapping[str, Any], operation_model: OperationModel, params: Mapping[str, Any]
@@ -59,14 +64,14 @@ def resolve_request_checksum_algorithm(
59
64
  request: Mapping[str, Any],
60
65
  operation_model: OperationModel,
61
66
  params: Mapping[str, Any],
62
- supported_algorithms: Optional[Sequence[str]] = ...,
67
+ supported_algorithms: Sequence[str] | None = ...,
63
68
  ) -> None: ...
64
69
  def apply_request_checksum(request: Mapping[str, Any]) -> None: ...
65
70
  def resolve_response_checksum_algorithms(
66
71
  request: Mapping[str, Any],
67
72
  operation_model: OperationModel,
68
73
  params: Mapping[str, Any],
69
- supported_algorithms: Optional[Sequence[str]] = ...,
74
+ supported_algorithms: Sequence[str] | None = ...,
70
75
  ) -> None: ...
71
76
  def handle_checksum_body(
72
77
  http_response: AWSHTTPResponse,
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for botocore.httpsession module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
8
+ from typing import Any, Mapping
3
9
 
4
10
  from botocore.awsrequest import AWSPreparedRequest, AWSRequest, AWSResponse
5
11
  from botocore.compat import IPV6_ADDRZ_RE as IPV6_ADDRZ_RE
@@ -19,15 +25,15 @@ logger: Logger = ...
19
25
  DEFAULT_TIMEOUT: int = ...
20
26
  MAX_POOL_CONNECTIONS: int = ...
21
27
  DEFAULT_CA_BUNDLE: str = ...
22
- DEFAULT_CIPHERS: Optional[str] = ...
28
+ DEFAULT_CIPHERS: str | None = ...
23
29
 
24
30
  def where() -> str: ...
25
- def get_cert_path(verify: bool) -> Optional[str]: ...
31
+ def get_cert_path(verify: bool) -> str | None: ...
26
32
  def create_urllib3_context(
27
- ssl_version: Optional[int] = ...,
28
- cert_reqs: Optional[bool] = ...,
29
- options: Optional[int] = ...,
30
- ciphers: Optional[str] = ...,
33
+ ssl_version: int | None = ...,
34
+ cert_reqs: bool | None = ...,
35
+ options: int | None = ...,
36
+ ciphers: str | None = ...,
31
37
  ) -> Any: ...
32
38
  def ensure_boolean(val: Any) -> bool: ...
33
39
  def mask_proxy_url(proxy_url: str) -> str: ...
@@ -35,24 +41,24 @@ def mask_proxy_url(proxy_url: str) -> str: ...
35
41
  class ProxyConfiguration:
36
42
  def __init__(
37
43
  self,
38
- proxies: Optional[Mapping[str, Any]] = ...,
39
- proxies_settings: Optional[Mapping[str, Any]] = ...,
44
+ proxies: Mapping[str, Any] | None = ...,
45
+ proxies_settings: Mapping[str, Any] | None = ...,
40
46
  ) -> None: ...
41
47
  def proxy_url_for(self, url: str) -> str: ...
42
- def proxy_headers_for(self, proxy_url: str) -> Dict[str, Any]: ...
48
+ def proxy_headers_for(self, proxy_url: str) -> dict[str, Any]: ...
43
49
  @property
44
- def settings(self) -> Dict[str, Any]: ...
50
+ def settings(self) -> dict[str, Any]: ...
45
51
 
46
52
  class URLLib3Session:
47
53
  def __init__(
48
54
  self,
49
55
  verify: bool = ...,
50
- proxies: Optional[Mapping[str, Any]] = ...,
51
- timeout: Optional[int] = ...,
56
+ proxies: Mapping[str, Any] | None = ...,
57
+ timeout: int | None = ...,
52
58
  max_pool_connections: int = ...,
53
- socket_options: Optional[List[str]] = ...,
54
- client_cert: Optional[Union[str, Tuple[str, str]]] = ...,
55
- proxies_config: Optional[Mapping[str, Any]] = ...,
59
+ socket_options: list[str] | None = ...,
60
+ client_cert: str | tuple[str, str] | None = ...,
61
+ proxies_config: Mapping[str, Any] | None = ...,
56
62
  ) -> None: ...
57
63
  def close(self) -> None: ...
58
- def send(self, request: Union[AWSRequest, AWSPreparedRequest]) -> AWSResponse: ...
64
+ def send(self, request: AWSRequest | AWSPreparedRequest) -> AWSResponse: ...
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for botocore.loaders module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Type
8
+ from typing import Any, Callable, Iterable, Mapping
3
9
 
4
10
  from botocore.compat import OrderedDict as OrderedDict
5
11
  from botocore.exceptions import DataNotFoundError as DataNotFoundError
@@ -16,33 +22,33 @@ class JSONFileLoader:
16
22
  def exists(self, file_path: str) -> bool: ...
17
23
  def load_file(self, file_path: str) -> Any: ...
18
24
 
19
- def create_loader(search_path_string: Optional[str] = ...) -> "Loader": ...
25
+ def create_loader(search_path_string: str | None = ...) -> Loader: ...
20
26
 
21
27
  class Loader:
22
- FILE_LOADER_CLASS: Type[JSONFileLoader] = ...
28
+ FILE_LOADER_CLASS: type[JSONFileLoader] = ...
23
29
  BUILTIN_DATA_PATH: str = ...
24
30
  CUSTOMER_DATA_PATH: str = ...
25
- BUILTIN_EXTRAS_TYPES: List[str] = ...
31
+ BUILTIN_EXTRAS_TYPES: list[str] = ...
26
32
  def __init__(
27
33
  self,
28
- extra_search_paths: Optional[Iterable[str]] = ...,
29
- file_loader: Optional[JSONFileLoader] = ...,
30
- cache: Optional[Any] = ...,
34
+ extra_search_paths: Iterable[str] | None = ...,
35
+ file_loader: JSONFileLoader | None = ...,
36
+ cache: Any | None = ...,
31
37
  include_default_search_paths: bool = ...,
32
38
  include_default_extras: bool = ...,
33
39
  ) -> None:
34
40
  self.file_loader: JSONFileLoader
35
41
 
36
42
  @property
37
- def search_paths(self) -> List[str]: ...
43
+ def search_paths(self) -> list[str]: ...
38
44
  @property
39
- def extras_types(self) -> List[str]: ...
40
- def list_available_services(self, type_name: str) -> List[str]: ...
45
+ def extras_types(self) -> list[str]: ...
46
+ def list_available_services(self, type_name: str) -> list[str]: ...
41
47
  def determine_latest_version(self, service_name: str, type_name: str) -> str: ...
42
- def list_api_versions(self, service_name: str, type_name: str) -> List[str]: ...
43
- def load_data_with_path(self, name: str) -> Tuple[Dict[str, Any], str]: ...
48
+ def list_api_versions(self, service_name: str, type_name: str) -> list[str]: ...
49
+ def load_data_with_path(self, name: str) -> tuple[dict[str, Any], str]: ...
44
50
  def load_service_model(
45
- self, service_name: str, type_name: str, api_version: Optional[Any] = ...
51
+ self, service_name: str, type_name: str, api_version: Any | None = ...
46
52
  ) -> Any: ...
47
53
  def load_data(self, name: str) -> Any: ...
48
54
  def is_builtin_path(self, path: str) -> bool: ...
botocore-stubs/model.pyi CHANGED
@@ -1,4 +1,10 @@
1
- from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Type, TypeVar, Union
1
+ """
2
+ Type annotations for botocore.model module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Mapping, NamedTuple, TypeVar
2
8
 
3
9
  from botocore.utils import CachedProperty
4
10
 
@@ -15,31 +21,31 @@ class ServiceId(str):
15
21
  def hyphenize(self) -> str: ...
16
22
 
17
23
  class Shape:
18
- SERIALIZED_ATTRS: List[str]
19
- METADATA_ATTRS: List[str]
20
- MAP_TYPE: Type[Dict[str, Any]]
24
+ SERIALIZED_ATTRS: list[str]
25
+ METADATA_ATTRS: list[str]
26
+ MAP_TYPE: type[dict[str, Any]]
21
27
  def __init__(
22
28
  self,
23
29
  shape_name: str,
24
30
  shape_model: Mapping[str, Any],
25
- shape_resolver: Optional["ShapeResolver"] = ...,
31
+ shape_resolver: ShapeResolver | None = ...,
26
32
  ) -> None:
27
33
  self.name: str
28
34
  self.type_name: str
29
35
  self.documentation: str
30
36
 
31
37
  @CachedProperty
32
- def serialization(self) -> Dict[str, Any]: ...
38
+ def serialization(self) -> dict[str, Any]: ...
33
39
  @CachedProperty
34
- def metadata(self) -> Dict[str, Any]: ...
40
+ def metadata(self) -> dict[str, Any]: ...
35
41
  @CachedProperty
36
- def required_members(self) -> List[str]: ...
42
+ def required_members(self) -> list[str]: ...
37
43
  @CachedProperty
38
44
  def event_stream_name(self) -> None: ...
39
45
 
40
46
  class StructureShape(Shape):
41
47
  @CachedProperty
42
- def members(self) -> Dict[str, Shape]: ...
48
+ def members(self) -> dict[str, Shape]: ...
43
49
  @CachedProperty
44
50
  def error_code(self) -> str: ...
45
51
  @CachedProperty
@@ -59,11 +65,11 @@ class MapShape(Shape):
59
65
 
60
66
  class StringShape(Shape):
61
67
  @CachedProperty
62
- def enum(self) -> List[str]: ...
68
+ def enum(self) -> list[str]: ...
63
69
 
64
70
  class StaticContextParameter(NamedTuple):
65
71
  name: str
66
- value: Union[bool, str]
72
+ value: bool | str
67
73
 
68
74
  class ContextParameter(NamedTuple):
69
75
  name: str
@@ -76,24 +82,24 @@ class ClientContextParameter(NamedTuple):
76
82
 
77
83
  class ServiceModel:
78
84
  def __init__(
79
- self, service_description: Mapping[str, Any], service_name: Optional[str] = ...
85
+ self, service_description: Mapping[str, Any], service_name: str | None = ...
80
86
  ) -> None:
81
- self.metadata: Dict[str, Any]
87
+ self.metadata: dict[str, Any]
82
88
 
83
89
  def shape_for(
84
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
90
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
85
91
  ) -> Shape: ...
86
92
  def shape_for_error_code(self, error_code: int) -> Shape: ...
87
93
  def resolve_shape_ref(self, shape_ref: str) -> Shape: ...
88
94
  @CachedProperty
89
- def shape_names(self) -> List[str]: ...
95
+ def shape_names(self) -> list[str]: ...
90
96
  @CachedProperty
91
- def error_shapes(self) -> List[Shape]: ...
92
- def operation_model(self, operation_name: str) -> "OperationModel": ...
97
+ def error_shapes(self) -> list[Shape]: ...
98
+ def operation_model(self, operation_name: str) -> OperationModel: ...
93
99
  @CachedProperty
94
100
  def documentation(self) -> str: ...
95
101
  @CachedProperty
96
- def operation_names(self) -> List[str]: ...
102
+ def operation_names(self) -> list[str]: ...
97
103
  @CachedProperty
98
104
  def service_name(self) -> str: ...
99
105
  @CachedProperty
@@ -107,25 +113,27 @@ class ServiceModel:
107
113
  @CachedProperty
108
114
  def endpoint_prefix(self) -> str: ...
109
115
  @CachedProperty
110
- def endpoint_discovery_operation(self) -> "OperationModel": ...
116
+ def endpoint_discovery_operation(self) -> OperationModel: ...
111
117
  @CachedProperty
112
118
  def endpoint_discovery_required(self) -> bool: ...
113
119
  @CachedProperty
114
- def client_context_parameters(self) -> List[ClientContextParameter]: ...
120
+ def client_context_parameters(self) -> list[ClientContextParameter]: ...
115
121
  @property
116
122
  def signature_version(self) -> str: ...
117
123
  @signature_version.setter
118
124
  def signature_version(self, value: str) -> None: ...
125
+ @CachedProperty
126
+ def is_query_compatible(self) -> bool: ...
119
127
 
120
128
  class OperationModel:
121
129
  def __init__(
122
130
  self,
123
131
  operation_model: Mapping[str, Any],
124
132
  service_model: ServiceModel,
125
- name: Optional[str] = None,
133
+ name: str | None = ...,
126
134
  ) -> None:
127
- self.metadata: Dict[str, Any]
128
- self.http: Dict[str, Any]
135
+ self.metadata: dict[str, Any]
136
+ self.http: dict[str, Any]
129
137
 
130
138
  @CachedProperty
131
139
  def name(self) -> str: ...
@@ -138,64 +146,72 @@ class OperationModel:
138
146
  @CachedProperty
139
147
  def deprecated(self) -> bool: ...
140
148
  @CachedProperty
141
- def endpoint_discovery(self) -> Optional["OperationModel"]: ...
149
+ def endpoint_discovery(self) -> OperationModel | None: ...
142
150
  @CachedProperty
143
151
  def is_endpoint_discovery_operation(self) -> bool: ...
144
152
  @CachedProperty
145
- def input_shape(self) -> Optional[StructureShape]: ...
153
+ def input_shape(self) -> StructureShape | None: ...
154
+ @CachedProperty
155
+ def output_shape(self) -> StructureShape | None: ...
156
+ @CachedProperty
157
+ def idempotent_members(self) -> list[str]: ...
158
+ @CachedProperty
159
+ def static_context_parameters(self) -> list[StaticContextParameter]: ...
160
+ @CachedProperty
161
+ def context_parameters(self) -> list[ContextParameter]: ...
146
162
  @CachedProperty
147
- def output_shape(self) -> Optional[StructureShape]: ...
163
+ def operation_context_parameters(self) -> list[ContextParameter]: ...
148
164
  @CachedProperty
149
- def idempotent_members(self) -> List[str]: ...
165
+ def request_compression(self) -> dict[str, Any] | None: ...
150
166
  @CachedProperty
151
- def static_context_parameters(self) -> List[StaticContextParameter]: ...
167
+ def auth(self) -> str | None: ...
152
168
  @CachedProperty
153
- def context_parameters(self) -> List[ContextParameter]: ...
169
+ def auth_type(self) -> str | None: ...
154
170
  @CachedProperty
155
- def request_compression(self) -> Optional[Dict[str, Any]]: ...
171
+ def resolved_auth_type(self) -> str | None: ...
156
172
  @CachedProperty
157
- def auth_type(self) -> Optional[str]: ...
173
+ def unsigned_payload(self) -> Any: ...
158
174
  @CachedProperty
159
- def error_shapes(self) -> List[Shape]: ...
175
+ def error_shapes(self) -> list[Shape]: ...
160
176
  @CachedProperty
161
- def endpoint(self) -> Optional[str]: ...
177
+ def endpoint(self) -> str | None: ...
162
178
  @CachedProperty
163
179
  def http_checksum_required(self) -> bool: ...
164
180
  @CachedProperty
165
- def http_checksum(self) -> Dict[str, Any]: ...
181
+ def http_checksum(self) -> dict[str, Any]: ...
166
182
  @CachedProperty
167
183
  def has_event_stream_input(self) -> bool: ...
168
184
  @CachedProperty
169
185
  def has_event_stream_output(self) -> bool: ...
170
- def get_event_stream_input(self) -> Optional[Shape]: ...
171
- def get_event_stream_output(self) -> Optional[Shape]: ...
186
+ def get_event_stream_input(self) -> Shape | None: ...
187
+ def get_event_stream_output(self) -> Shape | None: ...
172
188
  @CachedProperty
173
189
  def has_streaming_input(self) -> bool: ...
174
190
  @CachedProperty
175
191
  def has_streaming_output(self) -> bool: ...
176
- def get_streaming_input(self) -> Optional[Shape]: ...
177
- def get_streaming_output(self) -> Optional[Shape]: ...
192
+ def get_streaming_input(self) -> Shape | None: ...
193
+ def get_streaming_output(self) -> Shape | None: ...
178
194
 
179
195
  class ShapeResolver:
180
- SHAPE_CLASSES: Dict[str, Shape]
196
+ SHAPE_CLASSES: dict[str, Shape]
181
197
  def __init__(self, shape_map: Mapping[str, Shape]) -> None: ...
182
198
  def get_shape_by_name(
183
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
199
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
184
200
  ) -> Shape: ...
185
201
  def resolve_shape_ref(self, shape_ref: Mapping[str, Any]) -> Shape: ...
186
202
 
187
203
  class UnresolvableShapeMap:
188
204
  def get_shape_by_name(
189
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
205
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
190
206
  ) -> Shape: ...
191
207
  def resolve_shape_ref(self, shape_ref: Mapping[str, Any]) -> Shape: ...
192
208
 
193
209
  class DenormalizedStructureBuilder:
194
- SCALAR_TYPES: Tuple[str, ...]
210
+ SCALAR_TYPES: tuple[str, ...]
195
211
 
196
- def __init__(self, name: Optional[str] = ...) -> None:
212
+ def __init__(self, name: str | None = ...) -> None:
197
213
  self.name: str
198
- self.members: Dict[str, Any]
214
+ self.members: dict[str, Any]
199
215
 
200
216
  def with_members(self: _R, members: Mapping[str, Any]) -> _R: ...
201
217
  def build_model(self) -> StructureShape: ...
@@ -1,25 +1,30 @@
1
+ """
2
+ Type annotations for botocore.monitoring module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import socket
2
8
  from logging import Logger
3
- from typing import Any, Callable, Dict, Optional, Sequence
9
+ from typing import Any, Callable, Sequence
4
10
 
5
11
  from botocore.compat import ensure_bytes as ensure_bytes
6
12
  from botocore.compat import ensure_unicode as ensure_unicode
7
13
  from botocore.compat import urlparse as urlparse
8
14
  from botocore.hooks import BaseEventHooks
9
15
  from botocore.model import OperationModel
10
- from botocore.retryhandler import EXCEPTION_MAP as RETRYABLE_EXCEPTIONS
11
16
 
12
17
  logger: Logger = ...
13
18
 
14
19
  class Monitor:
15
- def __init__(self, adapter: Any, publisher: Any) -> None: ...
20
+ def __init__(self, adapter: MonitorEventAdapter, publisher: SocketPublisher) -> None: ...
16
21
  def register(self, event_emitter: BaseEventHooks) -> None: ...
17
22
  def capture(self, event_name: str, **payload: Any) -> None: ...
18
23
 
19
24
  class MonitorEventAdapter:
20
25
  def __init__(self, time: Callable[[], float] = ...) -> None: ...
21
26
  def feed(
22
- self, emitter_event_name: str, emitter_payload: Dict[str, Any]
27
+ self, emitter_event_name: str, emitter_payload: dict[str, Any]
23
28
  ) -> BaseMonitorEvent: ...
24
29
 
25
30
  class BaseMonitorEvent:
@@ -28,7 +33,7 @@ class BaseMonitorEvent:
28
33
  self.operation: str = ...
29
34
  self.timestamp: int = ...
30
35
 
31
- def __eq__(self, other: Any) -> bool: ...
36
+ def __eq__(self, other: object) -> bool: ...
32
37
 
33
38
  class APICallEvent(BaseMonitorEvent):
34
39
  def __init__(
@@ -36,8 +41,8 @@ class APICallEvent(BaseMonitorEvent):
36
41
  service: str,
37
42
  operation: OperationModel,
38
43
  timestamp: int,
39
- latency: Optional[int] = ...,
40
- attempts: Optional[Sequence[APICallAttemptEvent]] = ...,
44
+ latency: int | None = ...,
45
+ attempts: Sequence[APICallAttemptEvent] | None = ...,
41
46
  retries_exceeded: bool = ...,
42
47
  ) -> None:
43
48
  self.latency: int = ...
@@ -52,21 +57,21 @@ class APICallAttemptEvent(BaseMonitorEvent):
52
57
  service: str,
53
58
  operation: OperationModel,
54
59
  timestamp: int,
55
- latency: Optional[int] = ...,
56
- url: Optional[str] = ...,
57
- http_status_code: Optional[int] = ...,
58
- request_headers: Optional[Dict[str, Any]] = ...,
59
- response_headers: Optional[Dict[str, Any]] = ...,
60
- parsed_error: Optional[Dict[str, Any]] = ...,
61
- wire_exception: Optional[Exception] = ...,
60
+ latency: int | None = ...,
61
+ url: str | None = ...,
62
+ http_status_code: int | None = ...,
63
+ request_headers: dict[str, Any] | None = ...,
64
+ response_headers: dict[str, Any] | None = ...,
65
+ parsed_error: dict[str, Any] | None = ...,
66
+ wire_exception: Exception | None = ...,
62
67
  ) -> None:
63
- self.latency: Optional[int] = ...
64
- self.url: Optional[str] = ...
65
- self.http_status_code: Optional[int] = ...
66
- self.request_headers: Optional[Dict[str, Any]] = ...
67
- self.response_headers: Optional[Dict[str, Any]] = ...
68
- self.parsed_error: Optional[Dict[str, Any]] = ...
69
- self.wire_exception: Optional[Exception] = ...
68
+ self.latency: int | None = ...
69
+ self.url: str | None = ...
70
+ self.http_status_code: int | None = ...
71
+ self.request_headers: dict[str, Any] | None = ...
72
+ self.response_headers: dict[str, Any] | None = ...
73
+ self.parsed_error: dict[str, Any] | None = ...
74
+ self.wire_exception: Exception | None = ...
70
75
 
71
76
  class CSMSerializer:
72
77
  def __init__(self, csm_client_id: str) -> None:
@@ -75,5 +80,7 @@ class CSMSerializer:
75
80
  def serialize(self, event: BaseMonitorEvent) -> bytes: ...
76
81
 
77
82
  class SocketPublisher:
78
- def __init__(self, socket: socket.socket, host: str, port: int, serializer: Any) -> None: ...
83
+ def __init__(
84
+ self, socket: socket.socket, host: str, port: int, serializer: CSMSerializer
85
+ ) -> None: ...
79
86
  def publish(self, event: BaseMonitorEvent) -> None: ...