botocore-stubs 1.34.66__py3-none-any.whl → 1.35.98__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.98.dist-info}/METADATA +39 -20
  68. botocore_stubs-1.35.98.dist-info/RECORD +73 -0
  69. {botocore_stubs-1.34.66.dist-info → botocore_stubs-1.35.98.dist-info}/WHEEL +2 -1
  70. botocore_stubs-1.35.98.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.98.dist-info}/LICENSE +0 -0
@@ -1,5 +1,12 @@
1
- from typing import Any, Optional
1
+ """
2
+ Type annotations for botocore.docs.shape module.
2
3
 
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Mapping
8
+
9
+ from botocore.docs.bcdoc.restdoc import DocumentStructure
3
10
  from botocore.hooks import BaseEventHooks
4
11
  from botocore.model import Shape
5
12
 
@@ -10,15 +17,15 @@ class ShapeDocumenter:
10
17
  service_name: str,
11
18
  operation_name: str,
12
19
  event_emitter: BaseEventHooks,
13
- context: Any = ...,
20
+ context: Mapping[str, Any] | None = ...,
14
21
  ) -> None: ...
15
22
  def traverse_and_document_shape(
16
23
  self,
17
- section: Any,
24
+ section: DocumentStructure,
18
25
  shape: Shape,
19
26
  history: Any,
20
27
  include: Any = ...,
21
28
  exclude: Any = ...,
22
- name: Optional[str] = ...,
29
+ name: str | None = ...,
23
30
  is_required: bool = ...,
24
31
  ) -> None: ...
@@ -1,14 +1,28 @@
1
- from typing import Any
1
+ """
2
+ Type annotations for botocore.docs.sharedexample module.
2
3
 
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Iterable, Mapping
8
+
9
+ from botocore.docs.bcdoc.restdoc import DocumentStructure
3
10
  from botocore.model import OperationModel, Shape
4
11
 
5
12
  class SharedExampleDocumenter:
6
13
  def document_shared_example(
7
- self, example: Any, prefix: str, section: Any, operation_model: OperationModel
14
+ self, example: Any, prefix: str, section: DocumentStructure, operation_model: OperationModel
15
+ ) -> None: ...
16
+ def document_input(
17
+ self, section: DocumentStructure, example: Mapping[str, Any], prefix: str, shape: Shape
18
+ ) -> None: ...
19
+ def document_output(
20
+ self, section: DocumentStructure, example: Mapping[str, Any], shape: Shape
8
21
  ) -> None: ...
9
- def document_input(self, section: Any, example: Any, prefix: str, shape: Shape) -> None: ...
10
- def document_output(self, section: Any, example: Any, shape: Shape) -> None: ...
11
22
 
12
23
  def document_shared_examples(
13
- section: Any, operation_model: OperationModel, example_prefix: str, shared_examples: Any
24
+ section: DocumentStructure,
25
+ operation_model: OperationModel,
26
+ example_prefix: str,
27
+ shared_examples: Iterable[Mapping[str, Any]],
14
28
  ) -> None: ...
@@ -1,9 +1,15 @@
1
- from typing import Any, List
1
+ """
2
+ Type annotations for botocore.docs.translator module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any
2
8
 
3
9
  from sphinx.writers.html5 import HTML5Translator as SphinxHTML5Translator # type: ignore
4
10
 
5
11
  class BotoHTML5Translator(SphinxHTML5Translator):
6
- IGNORE_IMPLICIT_HEADINGS: List[str] = ...
12
+ IGNORE_IMPLICIT_HEADINGS: list[str] = ...
7
13
  def visit_admonition(self, node: Any, name: str = ...) -> None: ...
8
14
  def is_implicit_heading(self, node: Any) -> bool: ...
9
15
  def visit_paragraph(self, node: Any) -> None: ...
@@ -1,5 +1,12 @@
1
- from typing import Any, Callable, Dict, List, NamedTuple, Optional, Type
1
+ """
2
+ Type annotations for botocore.docs.utils module.
2
3
 
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any
8
+
9
+ from botocore.docs.bcdoc.restdoc import DocumentStructure
3
10
  from botocore.model import ServiceModel
4
11
 
5
12
  def py_type_name(type_name: str) -> str: ...
@@ -20,23 +27,21 @@ class DocumentedShape(_DocumentedShape):
20
27
  ) -> Any: ...
21
28
 
22
29
  class AutoPopulatedParam:
23
- def __init__(self, name: str, param_description: Optional[str] = ...) -> None: ...
30
+ def __init__(self, name: str, param_description: str | None = ...) -> None: ...
24
31
  def document_auto_populated_param(
25
- self, event_name: str, section: Any, **kwargs: Any
32
+ self, event_name: str, section: DocumentStructure, **kwargs: Any
26
33
  ) -> None: ...
27
34
 
28
35
  class HideParamFromOperations:
29
36
  def __init__(
30
- self, service_name: str, parameter_name: str, operation_names: List[str]
37
+ self, service_name: str, parameter_name: str, operation_names: list[str]
31
38
  ) -> None: ...
32
- def hide_param(self, event_name: str, section: Any, **kwargs: Any) -> None: ...
39
+ def hide_param(self, event_name: str, section: DocumentStructure, **kwargs: Any) -> None: ...
33
40
 
34
41
  class AppendParamDocumentation:
35
42
  def __init__(self, parameter_name: str, doc_string: str) -> None: ...
36
- def append_documentation(self, event_name: str, section: Any, **kwargs: Any) -> None: ...
37
-
38
- _CONTROLS: Dict[str, str] = ...
39
- _ESCAPE_CONTROLS_RE: Any = ...
40
- _CONTROLS_MATCH_HANDLER: Callable[..., str] = ...
43
+ def append_documentation(
44
+ self, event_name: str, section: DocumentStructure, **kwargs: Any
45
+ ) -> None: ...
41
46
 
42
47
  def escape_controls(value: str) -> str: ...
@@ -1,6 +1,11 @@
1
- from typing import Any
1
+ """
2
+ Type annotations for botocore.docs.waiter module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
2
6
 
3
7
  from botocore.client import BaseClient
8
+ from botocore.docs.bcdoc.restdoc import DocumentStructure
4
9
  from botocore.hooks import BaseEventHooks
5
10
  from botocore.model import ServiceModel
6
11
  from botocore.waiter import WaiterModel
@@ -9,10 +14,10 @@ class WaiterDocumenter:
9
14
  def __init__(
10
15
  self, client: BaseClient, service_waiter_model: WaiterModel, root_docs_path: str
11
16
  ) -> None: ...
12
- def document_waiters(self, section: Any) -> None: ...
17
+ def document_waiters(self, section: DocumentStructure) -> None: ...
13
18
 
14
19
  def document_wait_method(
15
- section: Any,
20
+ section: DocumentStructure,
16
21
  waiter_name: str,
17
22
  event_emitter: BaseEventHooks,
18
23
  service_model: ServiceModel,
@@ -1,6 +1,13 @@
1
+ """
2
+ Type annotations for botocore.endpoint module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Mapping, Optional, Type
8
+ from typing import Any, Mapping, Sequence
3
9
 
10
+ from botocore.awsrequest import AWSPreparedRequest
4
11
  from botocore.awsrequest import create_request_object as create_request_object
5
12
  from botocore.exceptions import HTTPClientError as HTTPClientError
6
13
  from botocore.history import get_global_history_recorder as get_global_history_recorder
@@ -8,6 +15,7 @@ from botocore.hooks import BaseEventHooks
8
15
  from botocore.hooks import first_non_none_response as first_non_none_response
9
16
  from botocore.httpsession import URLLib3Session as URLLib3Session
10
17
  from botocore.model import OperationModel, ServiceModel
18
+ from botocore.parsers import ResponseParserFactory
11
19
  from botocore.response import StreamingBody as StreamingBody
12
20
  from botocore.utils import get_environ_proxies as get_environ_proxies
13
21
  from botocore.utils import is_valid_endpoint_url as is_valid_endpoint_url
@@ -26,18 +34,20 @@ class Endpoint:
26
34
  host: str,
27
35
  endpoint_prefix: str,
28
36
  event_emitter: BaseEventHooks,
29
- response_parser_factory: Optional[Any] = ...,
30
- http_session: Optional[URLLib3Session] = ...,
37
+ response_parser_factory: Any | None = ...,
38
+ http_session: URLLib3Session | None = ...,
31
39
  ) -> None:
32
40
  self.host: str
33
41
  self.http_session: URLLib3Session
34
42
 
35
43
  def close(self) -> None: ...
36
- def make_request(self, operation_model: OperationModel, request_dict: Any) -> Any: ...
44
+ def make_request(
45
+ self, operation_model: OperationModel, request_dict: Mapping[str, Any]
46
+ ) -> Any: ...
37
47
  def create_request(
38
- self, params: Mapping[str, Any], operation_model: Optional[OperationModel] = ...
48
+ self, params: Mapping[str, Any], operation_model: OperationModel | None = ...
39
49
  ) -> Any: ...
40
- def prepare_request(self, request: Any) -> Any: ...
50
+ def prepare_request(self, request: Any) -> AWSPreparedRequest: ...
41
51
 
42
52
  class EndpointCreator:
43
53
  def __init__(self, event_emitter: BaseEventHooks) -> None: ...
@@ -46,13 +56,13 @@ class EndpointCreator:
46
56
  service_model: ServiceModel,
47
57
  region_name: str,
48
58
  endpoint_url: str,
49
- verify: Optional[Any] = ...,
50
- response_parser_factory: Optional[Any] = ...,
59
+ verify: bool | None = ...,
60
+ response_parser_factory: ResponseParserFactory | None = ...,
51
61
  timeout: float = ...,
52
- max_pool_connections: Any = ...,
53
- http_session_cls: Type[URLLib3Session] = ...,
54
- proxies: Optional[Any] = ...,
55
- socket_options: Optional[Any] = ...,
56
- client_cert: Optional[Any] = ...,
57
- proxies_config: Optional[Any] = ...,
62
+ max_pool_connections: int = ...,
63
+ http_session_cls: type[URLLib3Session] = ...,
64
+ proxies: Mapping[str, Any] | None = ...,
65
+ socket_options: Sequence[tuple[int, ...]] | None = ...,
66
+ client_cert: tuple[str, str] | str | None = ...,
67
+ proxies_config: Mapping[str, Any] | None = ...,
58
68
  ) -> Any: ...
@@ -1,19 +1,19 @@
1
+ """
2
+ Type annotations for botocore.endpoint_provider module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
- import re
3
8
  from enum import Enum
4
9
  from string import Formatter
5
10
  from typing import (
6
11
  Any,
7
12
  Callable,
8
- Dict,
9
13
  Iterable,
10
- List,
11
14
  Mapping,
12
15
  NamedTuple,
13
- Optional,
14
16
  Pattern,
15
- Type,
16
- Union,
17
17
  )
18
18
 
19
19
  from botocore.compat import quote as quote
@@ -36,7 +36,7 @@ STRING_FORMATTER: Formatter = ...
36
36
 
37
37
  class RuleSetStandardLibrary:
38
38
  def __init__(self, partitions_data: Mapping[str, Any]) -> None:
39
- self.partitions_data: Dict[str, Any]
39
+ self.partitions_data: dict[str, Any]
40
40
 
41
41
  def is_func(self, argument: Any) -> bool: ...
42
42
  def is_ref(self, argument: Any) -> bool: ...
@@ -49,14 +49,14 @@ class RuleSetStandardLibrary:
49
49
  ) -> Any: ...
50
50
  def is_set(self, value: Any) -> bool: ...
51
51
  def get_attr(self, value: Mapping[str, Any], path: str) -> Any: ...
52
- def format_partition_output(self, partition: Mapping[str, Any]) -> Dict[str, Any]: ...
52
+ def format_partition_output(self, partition: Mapping[str, Any]) -> dict[str, Any]: ...
53
53
  def is_partition_match(self, region: str, partition: Mapping[str, Any]) -> bool: ...
54
- def aws_partition(self, value: str) -> Dict[str, Any]: ...
55
- def aws_parse_arn(self, value: str) -> Dict[str, Any]: ...
54
+ def aws_partition(self, value: str) -> dict[str, Any]: ...
55
+ def aws_parse_arn(self, value: str) -> dict[str, Any]: ...
56
56
  def is_valid_host_label(self, value: str, allow_subdomains: bool) -> bool: ...
57
57
  def string_equals(self, value1: str, value2: str) -> bool: ...
58
58
  def uri_encode(self, value: str) -> str: ...
59
- def parse_url(self, value: str) -> Dict[str, Any]: ...
59
+ def parse_url(self, value: str) -> dict[str, Any]: ...
60
60
  def boolean_equals(self, value1: bool, value2: bool) -> bool: ...
61
61
  def is_ascii(self, value: str) -> bool: ...
62
62
  def substring(self, value: str, start: int, stop: int, reverse: bool) -> str: ...
@@ -66,10 +66,10 @@ RuleSetStandardLibary = RuleSetStandardLibrary
66
66
 
67
67
  class BaseRule:
68
68
  def __init__(
69
- self, conditions: Iterable[Callable[..., Any]], documentation: Optional[str] = ...
69
+ self, conditions: Iterable[Callable[..., Any]], documentation: str | None = ...
70
70
  ) -> None:
71
71
  self.conditions: Iterable[Callable[..., Any]]
72
- self.documentation: Optional[str]
72
+ self.documentation: str | None
73
73
 
74
74
  def evaluate(self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary) -> Any: ...
75
75
  def evaluate_conditions(
@@ -78,25 +78,25 @@ class BaseRule:
78
78
 
79
79
  class RuleSetEndpoint(NamedTuple):
80
80
  url: str
81
- properties: Dict[str, Any]
82
- headers: Dict[str, Any]
81
+ properties: dict[str, Any]
82
+ headers: dict[str, Any]
83
83
 
84
84
  class EndpointRule(BaseRule):
85
85
  def __init__(self, endpoint: Mapping[str, Any], **kwargs: Any) -> None:
86
- self.endpoint: Dict[str, Any]
86
+ self.endpoint: dict[str, Any]
87
87
 
88
88
  def evaluate(
89
89
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
90
90
  ) -> RuleSetEndpoint: ...
91
91
  def resolve_properties(
92
92
  self,
93
- properties: Union[Mapping[str, Any], List[Any], str],
93
+ properties: Mapping[str, Any] | list[Any] | str,
94
94
  scope_vars: Mapping[str, Any],
95
95
  rule_lib: RuleSetStandardLibary,
96
- ) -> Dict[str, Any]: ...
96
+ ) -> dict[str, Any]: ...
97
97
  def resolve_headers(
98
98
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
99
- ) -> Dict[str, Any]: ...
99
+ ) -> dict[str, Any]: ...
100
100
 
101
101
  class ErrorRule(BaseRule):
102
102
  def __init__(self, error: Any, **kwargs: Any) -> None:
@@ -106,41 +106,42 @@ class ErrorRule(BaseRule):
106
106
 
107
107
  class TreeRule(BaseRule):
108
108
  def __init__(self, rules: Iterable[Mapping[str, Any]], **kwargs: Any) -> None:
109
- self.rules: Iterable[Dict[str, Any]]
109
+ self.rules: Iterable[dict[str, Any]]
110
110
 
111
111
  def evaluate(
112
112
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
113
- ) -> Optional[RuleSetEndpoint]: ...
113
+ ) -> RuleSetEndpoint | None: ...
114
114
 
115
115
  class RuleCreator:
116
- endpoint: Type[EndpointRule]
117
- error: Type[ErrorRule]
118
- tree: Type[TreeRule]
116
+ endpoint: type[EndpointRule]
117
+ error: type[ErrorRule]
118
+ tree: type[TreeRule]
119
119
  @classmethod
120
120
  def create(cls, **kwargs: Any) -> BaseRule: ...
121
121
 
122
122
  class ParameterType(Enum):
123
- string: Type[str]
124
- boolean: Type[bool]
123
+ string = type(str)
124
+ boolean = type(bool)
125
+ stringarray = type(tuple)
125
126
 
126
127
  class ParameterDefinition:
127
128
  def __init__(
128
129
  self,
129
130
  name: str,
130
131
  parameter_type: ParameterType,
131
- documentation: Optional[str] = ...,
132
- builtIn: Optional[bool] = ...,
133
- default: Optional[bool] = ...,
134
- required: Optional[bool] = ...,
135
- deprecated: Optional[bool] = ...,
132
+ documentation: str | None = ...,
133
+ builtIn: bool | None = ...,
134
+ default: bool | None = ...,
135
+ required: bool | None = ...,
136
+ deprecated: bool | None = ...,
136
137
  ) -> None:
137
138
  self.name: str
138
139
  self.parameter_type: ParameterType
139
- self.documentation: Optional[str]
140
- self.built_in: Optional[bool]
141
- self.default: Optional[bool]
142
- self.required: Optional[bool]
143
- self.deprecated: Optional[bool]
140
+ self.documentation: str | None
141
+ self.built_in: bool | None
142
+ self.default: bool | None
143
+ self.required: bool | None
144
+ self.deprecated: bool | None
144
145
 
145
146
  def validate_input(self, value: Any) -> None: ...
146
147
  def process_input(self, value: Any) -> Any: ...
@@ -152,13 +153,13 @@ class RuleSet:
152
153
  parameters: Mapping[str, Any],
153
154
  rules: Iterable[Mapping[str, Any]],
154
155
  partitions: Any,
155
- documentation: Optional[str] = ...,
156
+ documentation: str | None = ...,
156
157
  ) -> None:
157
158
  self.version: str
158
- self.parameters: Dict[str, Any]
159
- self.rules: List[BaseRule]
159
+ self.parameters: dict[str, Any]
160
+ self.rules: list[BaseRule]
160
161
  self.rule_lib: RuleSetStandardLibary
161
- self.documentation: Optional[str]
162
+ self.documentation: str | None
162
163
 
163
164
  def process_input_parameters(self, input_params: Mapping[str, Any]) -> None: ...
164
165
  def evaluate(self, input_parameters: Mapping[str, Any]) -> Any: ...
@@ -1,4 +1,10 @@
1
- from typing import Mapping, Type
1
+ """
2
+ Type annotations for botocore.errorfactory module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Mapping
2
8
 
3
9
  from botocore.exceptions import ClientError as ClientError
4
10
  from botocore.exceptions import ClientError as _ClientError
@@ -6,8 +12,8 @@ from botocore.model import ServiceModel
6
12
  from botocore.utils import get_service_module_name as get_service_module_name
7
13
 
8
14
  class BaseClientExceptions:
9
- ClientError: Type[_ClientError] = ...
10
- def __init__(self, code_to_exception: Mapping[str, Type[_ClientError]]) -> None: ...
15
+ ClientError: type[_ClientError] = ... # noqa: F811
16
+ def __init__(self, code_to_exception: Mapping[str, type[_ClientError]]) -> None: ...
11
17
  def from_code(self, error_code: str) -> _ClientError: ...
12
18
  def __getattr__(self, name: str) -> None: ...
13
19
 
@@ -1,4 +1,10 @@
1
- from typing import Any, Dict, Generic, Iterator, Tuple, TypeVar
1
+ """
2
+ Type annotations for botocore.eventstream module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Generic, Iterator, TypeVar
2
8
 
3
9
  from botocore.exceptions import EventStreamError as EventStreamError
4
10
  from botocore.model import StructureShape
@@ -32,31 +38,31 @@ class DecodeUtils:
32
38
  INT32_BYTE_FORMAT: str = ...
33
39
  INT64_BYTE_FORMAT: str = ...
34
40
  PRELUDE_BYTE_FORMAT: str = ...
35
- UINT_BYTE_FORMAT: Dict[int, str] = ...
41
+ UINT_BYTE_FORMAT: dict[int, str] = ...
36
42
  @staticmethod
37
- def unpack_true(data: bytes) -> Tuple[bool, int]: ...
43
+ def unpack_true(data: bytes) -> tuple[bool, int]: ...
38
44
  @staticmethod
39
- def unpack_false(data: bytes) -> Tuple[bool, int]: ...
45
+ def unpack_false(data: bytes) -> tuple[bool, int]: ...
40
46
  @staticmethod
41
- def unpack_uint8(data: bytes) -> Tuple[int, int]: ...
47
+ def unpack_uint8(data: bytes) -> tuple[int, int]: ...
42
48
  @staticmethod
43
- def unpack_uint32(data: bytes) -> Tuple[int, int]: ...
49
+ def unpack_uint32(data: bytes) -> tuple[int, int]: ...
44
50
  @staticmethod
45
- def unpack_int8(data: bytes) -> Tuple[int, int]: ...
51
+ def unpack_int8(data: bytes) -> tuple[int, int]: ...
46
52
  @staticmethod
47
- def unpack_int16(data: bytes) -> Tuple[int, int]: ...
53
+ def unpack_int16(data: bytes) -> tuple[int, int]: ...
48
54
  @staticmethod
49
- def unpack_int32(data: bytes) -> Tuple[int, int]: ...
55
+ def unpack_int32(data: bytes) -> tuple[int, int]: ...
50
56
  @staticmethod
51
- def unpack_int64(data: bytes) -> Tuple[int, int]: ...
57
+ def unpack_int64(data: bytes) -> tuple[int, int]: ...
52
58
  @staticmethod
53
- def unpack_byte_array(data: bytes, length_byte_size: int = ...) -> Tuple[bytes, int]: ...
59
+ def unpack_byte_array(data: bytes, length_byte_size: int = ...) -> tuple[bytes, int]: ...
54
60
  @staticmethod
55
- def unpack_utf8_string(data: bytes, length_byte_size: int = ...) -> Tuple[str, int]: ...
61
+ def unpack_utf8_string(data: bytes, length_byte_size: int = ...) -> tuple[str, int]: ...
56
62
  @staticmethod
57
- def unpack_uuid(data: bytes) -> Tuple[bytes, int]: ...
63
+ def unpack_uuid(data: bytes) -> tuple[bytes, int]: ...
58
64
  @staticmethod
59
- def unpack_prelude(data: bytes) -> Tuple[Tuple[int, int, int], int]: ...
65
+ def unpack_prelude(data: bytes) -> tuple[tuple[int, int, int], int]: ...
60
66
 
61
67
  class MessagePrelude:
62
68
  def __init__(self, total_length: int, headers_length: int, crc: int) -> None:
@@ -78,11 +84,11 @@ class EventStreamMessage:
78
84
  self.payload: bytes = ...
79
85
  self.crc: int = ...
80
86
 
81
- def to_response_dict(self, status_code: int = ...) -> Dict[str, Any]: ...
87
+ def to_response_dict(self, status_code: int = ...) -> dict[str, Any]: ...
82
88
 
83
89
  class EventStreamHeaderParser:
84
90
  def __init__(self) -> None: ...
85
- def parse(self, data: bytes) -> Dict[str, Any]: ...
91
+ def parse(self, data: bytes) -> dict[str, Any]: ...
86
92
 
87
93
  class EventStreamBuffer:
88
94
  def __init__(self) -> None: ...
@@ -1,14 +1,14 @@
1
- import sys
2
- from typing import IO, Any, Dict, Iterable, List, Mapping
1
+ """
2
+ Type annotations for botocore.exceptions module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import IO, Any, Iterable, Mapping, TypedDict
3
8
 
4
9
  import requests
5
10
  from urllib3.exceptions import ReadTimeoutError as _ReadTimeoutError
6
11
 
7
- if sys.version_info >= (3, 9):
8
- from typing import TypedDict
9
- else:
10
- from typing_extensions import TypedDict
11
-
12
12
  class _ClientErrorResponseError(TypedDict, total=False):
13
13
  Code: str
14
14
  Message: str
@@ -17,7 +17,7 @@ class _ResponseMetadataTypeDef(TypedDict):
17
17
  RequestId: str
18
18
  HostId: str
19
19
  HTTPStatusCode: int
20
- HTTPHeaders: Dict[str, Any]
20
+ HTTPHeaders: dict[str, Any]
21
21
  RetryAttempts: int
22
22
 
23
23
  class _AttributeMapTypeDef(TypedDict, total=False):
@@ -34,7 +34,7 @@ class _ClientErrorResponseTypeDef(TypedDict, total=False):
34
34
  StatusReason: str
35
35
  Error: _ClientErrorResponseError
36
36
  ResponseMetadata: _ResponseMetadataTypeDef
37
- CancellationReasons: List[_CancellationReasonTypeDef]
37
+ CancellationReasons: list[_CancellationReasonTypeDef]
38
38
 
39
39
  class BotoCoreError(Exception):
40
40
  fmt: str
@@ -64,7 +64,7 @@ class _UnknownRegionErrorKwargs(TypedDict):
64
64
 
65
65
  class UnknownRegionError(BotoCoreError):
66
66
  def __init__(self, *, region_name: str = ..., error_msg: str = ..., **kwargs: Any) -> None:
67
- self.kwargs: _UnknownServiceErrorKwargs
67
+ self.kwargs: _UnknownRegionErrorKwargs
68
68
 
69
69
  class _ApiVersionNotFoundErrorKwargs(TypedDict):
70
70
  service_name: str
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for botocore.handlers module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Dict, Mapping, Pattern, Tuple
8
+ from typing import Any, Mapping, Pattern
3
9
  from urllib.request import Request
4
10
 
5
11
  from botocore.client import BaseClient
@@ -12,6 +18,7 @@ from botocore.compat import unquote as unquote
12
18
  from botocore.compat import unquote_str as unquote_str
13
19
  from botocore.compat import urlsplit as urlsplit
14
20
  from botocore.compat import urlunsplit as urlunsplit
21
+ from botocore.docs.bcdoc.restdoc import DocumentStructure
15
22
  from botocore.exceptions import AliasConflictParameterError as AliasConflictParameterError
16
23
  from botocore.exceptions import MissingServiceIdError as MissingServiceIdError
17
24
  from botocore.exceptions import ParamValidationError as ParamValidationError
@@ -28,13 +35,13 @@ from botocore.utils import switch_host_with_param as switch_host_with_param
28
35
 
29
36
  logger: Logger = ...
30
37
 
31
- REGISTER_FIRST: Any
32
- REGISTER_LAST: Any
38
+ REGISTER_FIRST: object
39
+ REGISTER_LAST: object
33
40
  VALID_BUCKET: Pattern[str]
34
41
  VALID_S3_ARN: Pattern[str]
35
- S3_SIGNING_NAMES: Tuple[str, ...]
42
+ S3_SIGNING_NAMES: tuple[str, ...]
36
43
  VERSION_ID_SUFFIX: Pattern[str]
37
- SERVICE_NAME_ALIASES: Dict[str, str]
44
+ SERVICE_NAME_ALIASES: dict[str, str]
38
45
 
39
46
  def handle_service_name_alias(service_name: str, **kwargs: Any) -> Any: ...
40
47
  def add_recursion_detection_header(params: Mapping[str, Any], **kwargs: Any) -> None: ...
@@ -55,9 +62,13 @@ def add_expect_header(model: OperationModel, params: Mapping[str, Any], **kwargs
55
62
 
56
63
  class DeprecatedServiceDocumenter:
57
64
  def __init__(self, replacement_service_name: str) -> None: ...
58
- def inject_deprecation_notice(self, section: Any, event_name: str, **kwargs: Any) -> None: ...
65
+ def inject_deprecation_notice(
66
+ self, section: DocumentStructure, event_name: str, **kwargs: Any
67
+ ) -> None: ...
59
68
 
60
- def document_copy_source_form(section: Any, event_name: str, **kwargs: Any) -> None: ...
69
+ def document_copy_source_form(
70
+ section: DocumentStructure, event_name: str, **kwargs: Any
71
+ ) -> None: ...
61
72
  def handle_copy_source_param(params: Mapping[str, Any], **kwargs: Any) -> None: ...
62
73
  def inject_presigned_url_ec2(
63
74
  params: Mapping[str, Any], request_signer: Any, model: OperationModel, **kwargs: Any
@@ -74,7 +85,7 @@ def parse_get_bucket_location(
74
85
  def base64_encode_user_data(params: Mapping[str, Any], **kwargs: Any) -> None: ...
75
86
  def document_base64_encoding(param: Mapping[str, Any]) -> Any: ...
76
87
  def validate_ascii_metadata(params: Mapping[str, Any], **kwargs: Any) -> None: ...
77
- def fix_route53_ids(params: Mapping[str, Any], model: Any, **kwargs: Any) -> None: ...
88
+ def fix_route53_ids(params: Mapping[str, Any], model: OperationModel, **kwargs: Any) -> None: ...
78
89
  def inject_account_id(params: Mapping[str, Any], **kwargs: Any) -> None: ...
79
90
  def add_glacier_version(
80
91
  model: OperationModel, params: Mapping[str, Any], **kwargs: Any
@@ -83,7 +94,7 @@ def add_accept_header(model: OperationModel, params: Mapping[str, Any], **kwargs
83
94
  def add_glacier_checksums(params: Mapping[str, Any], **kwargs: Any) -> None: ...
84
95
  def document_glacier_tree_hash_checksum() -> Any: ...
85
96
  def document_cloudformation_get_template_return_type(
86
- section: Any, event_name: str, **kwargs: Any
97
+ section: DocumentStructure, event_name: str, **kwargs: Any
87
98
  ) -> None: ...
88
99
  def switch_host_machinelearning(request: Any, **kwargs: Any) -> None: ...
89
100
  def check_openssl_supports_tls_version_1_2(**kwargs: Any) -> None: ...
@@ -102,7 +113,7 @@ class ParameterAlias:
102
113
  self, params: Mapping[str, Any], model: OperationModel, **kwargs: Any
103
114
  ) -> None: ...
104
115
  def alias_parameter_in_documentation(
105
- self, event_name: str, section: Any, **kwargs: Any
116
+ self, event_name: str, section: DocumentStructure, **kwargs: Any
106
117
  ) -> None: ...
107
118
 
108
119
  class ClientMethodAlias:
@@ -119,21 +130,32 @@ def inject_api_version_header_if_needed(
119
130
  def remove_lex_v2_start_conversation(
120
131
  class_attributes: Mapping[str, Any], **kwargs: Any
121
132
  ) -> None: ...
133
+ def remove_qbusiness_chat(class_attributes: Mapping[str, Any], **kwargs: Any) -> None: ...
122
134
  def add_retry_headers(request: Request, **kwargs: Any) -> None: ...
123
135
  def remove_bucket_from_url_paths_from_model(
124
- params: Mapping[str, Any], model: OperationModel, context: Any, **kwargs: Any
136
+ params: Mapping[str, Any], model: OperationModel, context: Mapping[str, Any], **kwargs: Any
125
137
  ) -> None: ...
126
138
  def remove_accid_host_prefix_from_model(
127
- params: Mapping[str, Any], model: OperationModel, context: Any, **kwargs: Any
139
+ params: Mapping[str, Any], model: OperationModel, context: Mapping[str, Any], **kwargs: Any
128
140
  ) -> None: ...
129
141
  def remove_arn_from_signing_path(request: Request, **kwargs: Any) -> None: ...
130
142
  def customize_endpoint_resolver_builtins(
131
143
  builtins: Mapping[str, Any],
132
144
  model: OperationModel,
133
145
  params: Mapping[str, Any],
134
- context: Any,
146
+ context: Mapping[str, Any],
135
147
  **kwargs: Any,
136
148
  ) -> None: ...
137
149
  def remove_content_type_header_for_presigning(request: Request, **kwargs: Any) -> None: ...
150
+ def handle_expires_header(
151
+ operation_model: OperationModel,
152
+ response_dict: Mapping[str, Any],
153
+ customized_response_dict: dict[str, Any],
154
+ **kwargs: Any,
155
+ ) -> None: ...
156
+ def document_expires_shape(section: DocumentStructure, event_name: str, **kwargs: Any) -> None: ...
157
+ def add_query_compatibility_header(
158
+ model: OperationModel, params: dict[str, Any], **kwargs: Any
159
+ ) -> None: ...
138
160
 
139
- BUILTIN_HANDLERS: Any
161
+ BUILTIN_HANDLERS: list[tuple[Any, ...]] = ...