botocore-stubs 1.35.69__py3-none-any.whl → 1.35.70__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 (70) hide show
  1. botocore-stubs/__init__.pyi +6 -2
  2. botocore-stubs/args.pyi +22 -24
  3. botocore-stubs/auth.pyi +34 -30
  4. botocore-stubs/awsrequest.pyi +25 -21
  5. botocore-stubs/client.pyi +31 -27
  6. botocore-stubs/compat.pyi +14 -9
  7. botocore-stubs/compress.pyi +6 -3
  8. botocore-stubs/config.pyi +27 -29
  9. botocore-stubs/configloader.pyi +9 -5
  10. botocore-stubs/configprovider.pyi +27 -25
  11. botocore-stubs/credentials.pyi +73 -69
  12. botocore-stubs/crt/__init__.pyi +1 -3
  13. botocore-stubs/crt/auth.pyi +4 -2
  14. botocore-stubs/discovery.pyi +11 -8
  15. botocore-stubs/docs/__init__.pyi +1 -3
  16. botocore-stubs/docs/bcdoc/docstringparser.pyi +11 -7
  17. botocore-stubs/docs/bcdoc/restdoc.pyi +10 -6
  18. botocore-stubs/docs/bcdoc/style.pyi +11 -7
  19. botocore-stubs/docs/client.pyi +8 -4
  20. botocore-stubs/docs/docstring.pyi +4 -2
  21. botocore-stubs/docs/example.pyi +20 -16
  22. botocore-stubs/docs/method.pyi +16 -12
  23. botocore-stubs/docs/paginator.pyi +4 -0
  24. botocore-stubs/docs/params.pyi +18 -14
  25. botocore-stubs/docs/service.pyi +6 -2
  26. botocore-stubs/docs/shape.pyi +6 -2
  27. botocore-stubs/docs/sharedexample.pyi +4 -0
  28. botocore-stubs/docs/translator.pyi +6 -2
  29. botocore-stubs/docs/utils.pyi +8 -4
  30. botocore-stubs/docs/waiter.pyi +4 -0
  31. botocore-stubs/endpoint.pyi +15 -11
  32. botocore-stubs/endpoint_provider.pyi +38 -39
  33. botocore-stubs/errorfactory.pyi +7 -3
  34. botocore-stubs/eventstream.pyi +20 -16
  35. botocore-stubs/exceptions.pyi +8 -10
  36. botocore-stubs/handlers.pyi +10 -6
  37. botocore-stubs/history.pyi +6 -2
  38. botocore-stubs/hooks.pyi +19 -17
  39. botocore-stubs/httpchecksum.pyi +13 -10
  40. botocore-stubs/httpsession.pyi +21 -17
  41. botocore-stubs/loaders.pyi +17 -13
  42. botocore-stubs/model.pyi +50 -46
  43. botocore-stubs/monitoring.pyi +23 -20
  44. botocore-stubs/paginate.pyi +7 -3
  45. botocore-stubs/parsers.pyi +11 -7
  46. botocore-stubs/regions.pyi +18 -14
  47. botocore-stubs/response.pyi +8 -4
  48. botocore-stubs/retries/adaptive.pyi +5 -1
  49. botocore-stubs/retries/bucket.pyi +4 -0
  50. botocore-stubs/retries/quota.pyi +6 -2
  51. botocore-stubs/retries/special.pyi +4 -0
  52. botocore-stubs/retries/standard.pyi +16 -12
  53. botocore-stubs/retries/throttling.pyi +4 -0
  54. botocore-stubs/retryhandler.pyi +10 -6
  55. botocore-stubs/serialize.pyi +11 -7
  56. botocore-stubs/session.pyi +43 -49
  57. botocore-stubs/signers.pyi +26 -24
  58. botocore-stubs/stub.pyi +13 -15
  59. botocore-stubs/tokens.pyi +10 -6
  60. botocore-stubs/translate.pyi +6 -2
  61. botocore-stubs/useragent.pyi +9 -5
  62. botocore-stubs/utils.pyi +57 -58
  63. botocore-stubs/validate.pyi +5 -1
  64. botocore-stubs/waiter.pyi +9 -5
  65. {botocore_stubs-1.35.69.dist-info → botocore_stubs-1.35.70.dist-info}/METADATA +1 -2
  66. botocore_stubs-1.35.70.dist-info/RECORD +73 -0
  67. botocore_stubs-1.35.69.dist-info/RECORD +0 -73
  68. {botocore_stubs-1.35.69.dist-info → botocore_stubs-1.35.70.dist-info}/LICENSE +0 -0
  69. {botocore_stubs-1.35.69.dist-info → botocore_stubs-1.35.70.dist-info}/WHEEL +0 -0
  70. {botocore_stubs-1.35.69.dist-info → botocore_stubs-1.35.70.dist-info}/top_level.txt +0 -0
botocore-stubs/model.pyi CHANGED
@@ -1,4 +1,8 @@
1
- from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Type, TypeVar, Union
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any, Mapping, NamedTuple, TypeVar
2
6
 
3
7
  from botocore.utils import CachedProperty
4
8
 
@@ -15,31 +19,31 @@ class ServiceId(str):
15
19
  def hyphenize(self) -> str: ...
16
20
 
17
21
  class Shape:
18
- SERIALIZED_ATTRS: List[str]
19
- METADATA_ATTRS: List[str]
20
- MAP_TYPE: Type[Dict[str, Any]]
22
+ SERIALIZED_ATTRS: list[str]
23
+ METADATA_ATTRS: list[str]
24
+ MAP_TYPE: type[dict[str, Any]]
21
25
  def __init__(
22
26
  self,
23
27
  shape_name: str,
24
28
  shape_model: Mapping[str, Any],
25
- shape_resolver: Optional["ShapeResolver"] = ...,
29
+ shape_resolver: ShapeResolver | None = ...,
26
30
  ) -> None:
27
31
  self.name: str
28
32
  self.type_name: str
29
33
  self.documentation: str
30
34
 
31
35
  @CachedProperty
32
- def serialization(self) -> Dict[str, Any]: ...
36
+ def serialization(self) -> dict[str, Any]: ...
33
37
  @CachedProperty
34
- def metadata(self) -> Dict[str, Any]: ...
38
+ def metadata(self) -> dict[str, Any]: ...
35
39
  @CachedProperty
36
- def required_members(self) -> List[str]: ...
40
+ def required_members(self) -> list[str]: ...
37
41
  @CachedProperty
38
42
  def event_stream_name(self) -> None: ...
39
43
 
40
44
  class StructureShape(Shape):
41
45
  @CachedProperty
42
- def members(self) -> Dict[str, Shape]: ...
46
+ def members(self) -> dict[str, Shape]: ...
43
47
  @CachedProperty
44
48
  def error_code(self) -> str: ...
45
49
  @CachedProperty
@@ -59,11 +63,11 @@ class MapShape(Shape):
59
63
 
60
64
  class StringShape(Shape):
61
65
  @CachedProperty
62
- def enum(self) -> List[str]: ...
66
+ def enum(self) -> list[str]: ...
63
67
 
64
68
  class StaticContextParameter(NamedTuple):
65
69
  name: str
66
- value: Union[bool, str]
70
+ value: bool | str
67
71
 
68
72
  class ContextParameter(NamedTuple):
69
73
  name: str
@@ -76,24 +80,24 @@ class ClientContextParameter(NamedTuple):
76
80
 
77
81
  class ServiceModel:
78
82
  def __init__(
79
- self, service_description: Mapping[str, Any], service_name: Optional[str] = ...
83
+ self, service_description: Mapping[str, Any], service_name: str | None = ...
80
84
  ) -> None:
81
- self.metadata: Dict[str, Any]
85
+ self.metadata: dict[str, Any]
82
86
 
83
87
  def shape_for(
84
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
88
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
85
89
  ) -> Shape: ...
86
90
  def shape_for_error_code(self, error_code: int) -> Shape: ...
87
91
  def resolve_shape_ref(self, shape_ref: str) -> Shape: ...
88
92
  @CachedProperty
89
- def shape_names(self) -> List[str]: ...
93
+ def shape_names(self) -> list[str]: ...
90
94
  @CachedProperty
91
- def error_shapes(self) -> List[Shape]: ...
92
- def operation_model(self, operation_name: str) -> "OperationModel": ...
95
+ def error_shapes(self) -> list[Shape]: ...
96
+ def operation_model(self, operation_name: str) -> OperationModel: ...
93
97
  @CachedProperty
94
98
  def documentation(self) -> str: ...
95
99
  @CachedProperty
96
- def operation_names(self) -> List[str]: ...
100
+ def operation_names(self) -> list[str]: ...
97
101
  @CachedProperty
98
102
  def service_name(self) -> str: ...
99
103
  @CachedProperty
@@ -107,11 +111,11 @@ class ServiceModel:
107
111
  @CachedProperty
108
112
  def endpoint_prefix(self) -> str: ...
109
113
  @CachedProperty
110
- def endpoint_discovery_operation(self) -> "OperationModel": ...
114
+ def endpoint_discovery_operation(self) -> OperationModel: ...
111
115
  @CachedProperty
112
116
  def endpoint_discovery_required(self) -> bool: ...
113
117
  @CachedProperty
114
- def client_context_parameters(self) -> List[ClientContextParameter]: ...
118
+ def client_context_parameters(self) -> list[ClientContextParameter]: ...
115
119
  @property
116
120
  def signature_version(self) -> str: ...
117
121
  @signature_version.setter
@@ -124,10 +128,10 @@ class OperationModel:
124
128
  self,
125
129
  operation_model: Mapping[str, Any],
126
130
  service_model: ServiceModel,
127
- name: Optional[str] = None,
131
+ name: str | None = None,
128
132
  ) -> None:
129
- self.metadata: Dict[str, Any]
130
- self.http: Dict[str, Any]
133
+ self.metadata: dict[str, Any]
134
+ self.http: dict[str, Any]
131
135
 
132
136
  @CachedProperty
133
137
  def name(self) -> str: ...
@@ -140,70 +144,70 @@ class OperationModel:
140
144
  @CachedProperty
141
145
  def deprecated(self) -> bool: ...
142
146
  @CachedProperty
143
- def endpoint_discovery(self) -> Optional["OperationModel"]: ...
147
+ def endpoint_discovery(self) -> OperationModel | None: ...
144
148
  @CachedProperty
145
149
  def is_endpoint_discovery_operation(self) -> bool: ...
146
150
  @CachedProperty
147
- def input_shape(self) -> Optional[StructureShape]: ...
151
+ def input_shape(self) -> StructureShape | None: ...
148
152
  @CachedProperty
149
- def output_shape(self) -> Optional[StructureShape]: ...
153
+ def output_shape(self) -> StructureShape | None: ...
150
154
  @CachedProperty
151
- def idempotent_members(self) -> List[str]: ...
155
+ def idempotent_members(self) -> list[str]: ...
152
156
  @CachedProperty
153
- def static_context_parameters(self) -> List[StaticContextParameter]: ...
157
+ def static_context_parameters(self) -> list[StaticContextParameter]: ...
154
158
  @CachedProperty
155
- def context_parameters(self) -> List[ContextParameter]: ...
159
+ def context_parameters(self) -> list[ContextParameter]: ...
156
160
  @CachedProperty
157
- def request_compression(self) -> Optional[Dict[str, Any]]: ...
161
+ def request_compression(self) -> dict[str, Any] | None: ...
158
162
  @CachedProperty
159
- def auth(self) -> Optional[str]: ...
163
+ def auth(self) -> str | None: ...
160
164
  @CachedProperty
161
- def auth_type(self) -> Optional[str]: ...
165
+ def auth_type(self) -> str | None: ...
162
166
  @CachedProperty
163
- def resolved_auth_type(self) -> Optional[str]: ...
167
+ def resolved_auth_type(self) -> str | None: ...
164
168
  @CachedProperty
165
169
  def unsigned_payload(self) -> Any: ...
166
170
  @CachedProperty
167
- def error_shapes(self) -> List[Shape]: ...
171
+ def error_shapes(self) -> list[Shape]: ...
168
172
  @CachedProperty
169
- def endpoint(self) -> Optional[str]: ...
173
+ def endpoint(self) -> str | None: ...
170
174
  @CachedProperty
171
175
  def http_checksum_required(self) -> bool: ...
172
176
  @CachedProperty
173
- def http_checksum(self) -> Dict[str, Any]: ...
177
+ def http_checksum(self) -> dict[str, Any]: ...
174
178
  @CachedProperty
175
179
  def has_event_stream_input(self) -> bool: ...
176
180
  @CachedProperty
177
181
  def has_event_stream_output(self) -> bool: ...
178
- def get_event_stream_input(self) -> Optional[Shape]: ...
179
- def get_event_stream_output(self) -> Optional[Shape]: ...
182
+ def get_event_stream_input(self) -> Shape | None: ...
183
+ def get_event_stream_output(self) -> Shape | None: ...
180
184
  @CachedProperty
181
185
  def has_streaming_input(self) -> bool: ...
182
186
  @CachedProperty
183
187
  def has_streaming_output(self) -> bool: ...
184
- def get_streaming_input(self) -> Optional[Shape]: ...
185
- def get_streaming_output(self) -> Optional[Shape]: ...
188
+ def get_streaming_input(self) -> Shape | None: ...
189
+ def get_streaming_output(self) -> Shape | None: ...
186
190
 
187
191
  class ShapeResolver:
188
- SHAPE_CLASSES: Dict[str, Shape]
192
+ SHAPE_CLASSES: dict[str, Shape]
189
193
  def __init__(self, shape_map: Mapping[str, Shape]) -> None: ...
190
194
  def get_shape_by_name(
191
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
195
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
192
196
  ) -> Shape: ...
193
197
  def resolve_shape_ref(self, shape_ref: Mapping[str, Any]) -> Shape: ...
194
198
 
195
199
  class UnresolvableShapeMap:
196
200
  def get_shape_by_name(
197
- self, shape_name: str, member_traits: Optional[Mapping[str, Any]] = ...
201
+ self, shape_name: str, member_traits: Mapping[str, Any] | None = ...
198
202
  ) -> Shape: ...
199
203
  def resolve_shape_ref(self, shape_ref: Mapping[str, Any]) -> Shape: ...
200
204
 
201
205
  class DenormalizedStructureBuilder:
202
- SCALAR_TYPES: Tuple[str, ...]
206
+ SCALAR_TYPES: tuple[str, ...]
203
207
 
204
- def __init__(self, name: Optional[str] = ...) -> None:
208
+ def __init__(self, name: str | None = ...) -> None:
205
209
  self.name: str
206
- self.members: Dict[str, Any]
210
+ self.members: dict[str, Any]
207
211
 
208
212
  def with_members(self: _R, members: Mapping[str, Any]) -> _R: ...
209
213
  def build_model(self) -> StructureShape: ...
@@ -1,13 +1,16 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  import socket
2
6
  from logging import Logger
3
- from typing import Any, Callable, Dict, Optional, Sequence
7
+ from typing import Any, Callable, Sequence
4
8
 
5
9
  from botocore.compat import ensure_bytes as ensure_bytes
6
10
  from botocore.compat import ensure_unicode as ensure_unicode
7
11
  from botocore.compat import urlparse as urlparse
8
12
  from botocore.hooks import BaseEventHooks
9
13
  from botocore.model import OperationModel
10
- from botocore.retryhandler import EXCEPTION_MAP as RETRYABLE_EXCEPTIONS
11
14
 
12
15
  logger: Logger = ...
13
16
 
@@ -19,7 +22,7 @@ class Monitor:
19
22
  class MonitorEventAdapter:
20
23
  def __init__(self, time: Callable[[], float] = ...) -> None: ...
21
24
  def feed(
22
- self, emitter_event_name: str, emitter_payload: Dict[str, Any]
25
+ self, emitter_event_name: str, emitter_payload: dict[str, Any]
23
26
  ) -> BaseMonitorEvent: ...
24
27
 
25
28
  class BaseMonitorEvent:
@@ -28,7 +31,7 @@ class BaseMonitorEvent:
28
31
  self.operation: str = ...
29
32
  self.timestamp: int = ...
30
33
 
31
- def __eq__(self, other: Any) -> bool: ...
34
+ def __eq__(self, other: object) -> bool: ...
32
35
 
33
36
  class APICallEvent(BaseMonitorEvent):
34
37
  def __init__(
@@ -36,8 +39,8 @@ class APICallEvent(BaseMonitorEvent):
36
39
  service: str,
37
40
  operation: OperationModel,
38
41
  timestamp: int,
39
- latency: Optional[int] = ...,
40
- attempts: Optional[Sequence[APICallAttemptEvent]] = ...,
42
+ latency: int | None = ...,
43
+ attempts: Sequence[APICallAttemptEvent] | None = ...,
41
44
  retries_exceeded: bool = ...,
42
45
  ) -> None:
43
46
  self.latency: int = ...
@@ -52,21 +55,21 @@ class APICallAttemptEvent(BaseMonitorEvent):
52
55
  service: str,
53
56
  operation: OperationModel,
54
57
  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] = ...,
58
+ latency: int | None = ...,
59
+ url: str | None = ...,
60
+ http_status_code: int | None = ...,
61
+ request_headers: dict[str, Any] | None = ...,
62
+ response_headers: dict[str, Any] | None = ...,
63
+ parsed_error: dict[str, Any] | None = ...,
64
+ wire_exception: Exception | None = ...,
62
65
  ) -> 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] = ...
66
+ self.latency: int | None = ...
67
+ self.url: str | None = ...
68
+ self.http_status_code: int | None = ...
69
+ self.request_headers: dict[str, Any] | None = ...
70
+ self.response_headers: dict[str, Any] | None = ...
71
+ self.parsed_error: dict[str, Any] | None = ...
72
+ self.wire_exception: Exception | None = ...
70
73
 
71
74
  class CSMSerializer:
72
75
  def __init__(self, csm_client_id: str) -> None:
@@ -1,5 +1,9 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Dict, Iterator
6
+ from typing import Any, Iterator
3
7
 
4
8
  from botocore.exceptions import PaginationError as PaginationError
5
9
  from botocore.utils import merge_dicts as merge_dicts
@@ -8,10 +12,10 @@ from botocore.utils import set_value_from_jmespath as set_value_from_jmespath
8
12
  log: Logger = ...
9
13
 
10
14
  class TokenEncoder:
11
- def encode(self, token: Dict[str, Any]) -> str: ...
15
+ def encode(self, token: dict[str, Any]) -> str: ...
12
16
 
13
17
  class TokenDecoder:
14
- def decode(self, token: str) -> Dict[str, Any]: ...
18
+ def decode(self, token: str) -> dict[str, Any]: ...
15
19
 
16
20
  class PaginatorModel:
17
21
  def __init__(self, paginator_config: Any) -> None: ...
@@ -1,5 +1,9 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Callable, Dict, Mapping, Optional, Type
6
+ from typing import Any, Callable, Mapping
3
7
 
4
8
  from botocore.compat import XMLParseError as XMLParseError
5
9
  from botocore.eventstream import EventStream as EventStream
@@ -24,19 +28,19 @@ class ResponseParserError(Exception): ...
24
28
 
25
29
  class ResponseParser:
26
30
  DEFAULT_ENCODING: str = ...
27
- EVENT_STREAM_PARSER_CLS: Optional[Type[ResponseParser]] = ...
31
+ EVENT_STREAM_PARSER_CLS: type[ResponseParser] | None = ...
28
32
  def __init__(
29
33
  self,
30
- timestamp_parser: Optional[Callable[[str], Any]] = ...,
31
- blob_parser: Optional[Callable[[str], Any]] = ...,
34
+ timestamp_parser: Callable[[str], Any] | None = ...,
35
+ blob_parser: Callable[[str], Any] | None = ...,
32
36
  ) -> None: ...
33
37
  def parse(self, response: Mapping[str, Any], shape: Shape) -> Any: ...
34
38
 
35
39
  class BaseXMLResponseParser(ResponseParser):
36
40
  def __init__(
37
41
  self,
38
- timestamp_parser: Optional[Callable[[str], Any]] = ...,
39
- blob_parser: Optional[Callable[[str], Any]] = ...,
42
+ timestamp_parser: Callable[[str], Any] | None = ...,
43
+ blob_parser: Callable[[str], Any] | None = ...,
40
44
  ) -> None: ...
41
45
 
42
46
  class QueryParser(BaseXMLResponseParser): ...
@@ -50,4 +54,4 @@ class BaseRestParser(ResponseParser): ...
50
54
  class RestJSONParser(BaseRestParser, BaseJSONParser): ...
51
55
  class RestXMLParser(BaseRestParser, BaseXMLResponseParser): ...
52
56
 
53
- PROTOCOL_PARSERS: Dict[str, ResponseParser]
57
+ PROTOCOL_PARSERS: dict[str, ResponseParser]
@@ -1,6 +1,10 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from enum import Enum
2
6
  from logging import Logger
3
- from typing import Any, Dict, List, Mapping, Optional, Tuple
7
+ from typing import Any, Mapping
4
8
 
5
9
  from botocore.auth import AUTH_TYPE_MAPS as AUTH_TYPE_MAPS
6
10
  from botocore.compat import HAS_CRT as HAS_CRT
@@ -13,40 +17,40 @@ from botocore.model import OperationModel, ServiceModel
13
17
 
14
18
  LOG: Logger = ...
15
19
  DEFAULT_URI_TEMPLATE: str
16
- DEFAULT_SERVICE_DATA: Dict[str, Dict[str, Any]]
20
+ DEFAULT_SERVICE_DATA: dict[str, dict[str, Any]]
17
21
 
18
22
  class BaseEndpointResolver:
19
- def construct_endpoint(self, service_name: str, region_name: Optional[str] = ...) -> None: ...
20
- def get_available_partitions(self) -> List[str]: ...
23
+ def construct_endpoint(self, service_name: str, region_name: str | None = ...) -> None: ...
24
+ def get_available_partitions(self) -> list[str]: ...
21
25
  def get_available_endpoints(
22
26
  self,
23
27
  service_name: str,
24
28
  partition_name: str = ...,
25
29
  allow_non_regional: bool = ...,
26
- ) -> List[str]: ...
30
+ ) -> list[str]: ...
27
31
 
28
32
  class EndpointResolver(BaseEndpointResolver):
29
33
  def __init__(self, endpoint_data: Mapping[str, Any], uses_builtin_data: bool = ...) -> None: ...
30
34
  def get_service_endpoints_data(self, service_name: str, partition_name: str = ...) -> Any: ...
31
- def get_available_partitions(self) -> List[str]: ...
35
+ def get_available_partitions(self) -> list[str]: ...
32
36
  def get_available_endpoints(
33
37
  self,
34
38
  service_name: str,
35
39
  partition_name: str = ...,
36
40
  allow_non_regional: bool = ...,
37
41
  endpoint_variant_tags: Any = ...,
38
- ) -> List[str]: ...
42
+ ) -> list[str]: ...
39
43
  def get_partition_dns_suffix(
40
44
  self, partition_name: str, endpoint_variant_tags: Any = ...
41
45
  ) -> str: ...
42
46
  def construct_endpoint( # type: ignore [override]
43
47
  self,
44
48
  service_name: str,
45
- region_name: Optional[str] = ...,
46
- partition_name: Optional[str] = ...,
49
+ region_name: str | None = ...,
50
+ partition_name: str | None = ...,
47
51
  use_dualstack_endpoint: bool = ...,
48
52
  use_fips_endpoint: bool = ...,
49
- ) -> Optional[Dict[str, Any]]: ...
53
+ ) -> dict[str, Any] | None: ...
50
54
  def get_partition_for_region(self, region_name: str) -> str: ...
51
55
 
52
56
  class EndpointResolverBuiltins(Enum):
@@ -74,17 +78,17 @@ class EndpointRulesetResolver:
74
78
  client_context: Any,
75
79
  event_emitter: BaseEventHooks,
76
80
  use_ssl: bool = ...,
77
- requested_auth_scheme: Optional[str] = ...,
81
+ requested_auth_scheme: str | None = ...,
78
82
  ) -> None: ...
79
83
  def construct_endpoint(
80
84
  self,
81
85
  operation_model: OperationModel,
82
- call_args: Optional[Mapping[str, Any]],
86
+ call_args: Mapping[str, Any] | None,
83
87
  request_context: Any,
84
88
  ) -> RuleSetEndpoint: ...
85
89
  def auth_schemes_to_signing_ctx(
86
- self, auth_schemes: List[Mapping[str, Any]]
87
- ) -> Tuple[str, Dict[str, Any]]: ...
90
+ self, auth_schemes: list[Mapping[str, Any]]
91
+ ) -> tuple[str, dict[str, Any]]: ...
88
92
  def ruleset_error_to_botocore_exception(
89
93
  self, ruleset_exception: Exception, params: Mapping[str, Any]
90
94
  ) -> BotoCoreError: ...
@@ -1,6 +1,10 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  import logging
2
6
  from io import IOBase
3
- from typing import IO, Any, Iterator, List, Optional, Tuple
7
+ from typing import IO, Any, Iterator
4
8
 
5
9
  import requests
6
10
  from botocore.model import OperationModel
@@ -11,9 +15,9 @@ class StreamingBody(IOBase):
11
15
  def __init__(self, raw_stream: IO[bytes], content_length: int) -> None: ...
12
16
  def set_socket_timeout(self, timeout: float) -> None: ...
13
17
  def readable(self) -> bool: ...
14
- def read(self, amt: Optional[int] = ...) -> bytes: ...
18
+ def read(self, amt: int | None = ...) -> bytes: ...
15
19
  # FIXME: Signature of "readlines" incompatible with supertype "IOBase"
16
- def readlines(self) -> List[bytes]: ... # type: ignore [override]
20
+ def readlines(self) -> list[bytes]: ... # type: ignore [override]
17
21
  def __iter__(self) -> Iterator[bytes]: ...
18
22
  def iter_lines(self, chunk_size: int = ..., keepends: bool = ...) -> Iterator[bytes]: ...
19
23
  def iter_chunks(self, chunk_size: int = ...) -> Iterator[bytes]: ...
@@ -23,4 +27,4 @@ class StreamingBody(IOBase):
23
27
 
24
28
  def get_response(
25
29
  operation_model: OperationModel, http_response: requests.Response
26
- ) -> Tuple[requests.Response, Any]: ...
30
+ ) -> tuple[requests.Response, Any]: ...
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
6
  from typing import Any
3
7
 
@@ -8,7 +12,7 @@ from botocore.retries import throttling as throttling
8
12
 
9
13
  logger: Logger = ...
10
14
 
11
- def register_retry_handler(client: BaseClient) -> "ClientRateLimiter": ...
15
+ def register_retry_handler(client: BaseClient) -> ClientRateLimiter: ...
12
16
 
13
17
  class ClientRateLimiter:
14
18
  def __init__(
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any
2
6
 
3
7
  from botocore.exceptions import CapacityNotAvailableError as CapacityNotAvailableError
@@ -1,8 +1,12 @@
1
- from typing import Any, Optional
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any
2
6
 
3
7
  class RetryQuota:
4
8
  INITIAL_CAPACITY: int = ...
5
- def __init__(self, initial_capacity: Any = ..., lock: Optional[Any] = ...) -> None: ...
9
+ def __init__(self, initial_capacity: Any = ..., lock: Any | None = ...) -> None: ...
6
10
  def acquire(self, capacity_amount: Any) -> Any: ...
7
11
  def release(self, capacity_amount: Any) -> None: ...
8
12
  @property
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
6
  from typing import Any
3
7
 
@@ -1,5 +1,9 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Callable, Optional, Sequence, Type
6
+ from typing import Any, Callable, Sequence
3
7
 
4
8
  from botocore.client import BaseClient
5
9
  from botocore.exceptions import BotoCoreError
@@ -27,7 +31,7 @@ class RetryHandler:
27
31
  retry_event_adapter: RetryEventAdapter,
28
32
  retry_quota: RetryQuota,
29
33
  ) -> None: ...
30
- def needs_retry(self, **kwargs: Any) -> Optional[float]: ...
34
+ def needs_retry(self, **kwargs: Any) -> float | None: ...
31
35
 
32
36
  class RetryEventAdapter:
33
37
  def create_retry_context(self, **kwargs: Any) -> Any: ...
@@ -37,20 +41,20 @@ class RetryContext:
37
41
  def __init__(
38
42
  self,
39
43
  attempt_number: int,
40
- operation_model: Optional[OperationModel] = ...,
44
+ operation_model: OperationModel | None = ...,
41
45
  parsed_response: Any = ...,
42
46
  http_response: Any = ...,
43
- caught_exception: Optional[Exception] = ...,
47
+ caught_exception: Exception | None = ...,
44
48
  request_context: Any = ...,
45
49
  ) -> None:
46
50
  self.attempt_number: int = ...
47
- self.operation_model: Optional[OperationModel] = ...
51
+ self.operation_model: OperationModel | None = ...
48
52
  self.parsed_response: Any = ...
49
53
  self.http_response: Any = ...
50
- self.caught_exception: Optional[Exception] = ...
54
+ self.caught_exception: Exception | None = ...
51
55
  self.request_context: Any = ...
52
56
 
53
- def get_error_code(self) -> Optional[int]: ...
57
+ def get_error_code(self) -> int | None: ...
54
58
  def add_retry_metadata(self, **kwargs: Any) -> None: ...
55
59
  def get_retry_metadata(self) -> Any: ...
56
60
 
@@ -72,14 +76,14 @@ class MaxAttemptsChecker(BaseRetryableChecker):
72
76
  class TransientRetryableChecker(BaseRetryableChecker):
73
77
  def __init__(
74
78
  self,
75
- transient_error_codes: Optional[Sequence[str]] = ...,
76
- transient_status_codes: Optional[Sequence[int]] = ...,
77
- transient_exception_cls: Optional[Sequence[Type[BotoCoreError]]] = ...,
79
+ transient_error_codes: Sequence[str] | None = ...,
80
+ transient_status_codes: Sequence[int] | None = ...,
81
+ transient_exception_cls: Sequence[type[BotoCoreError]] | None = ...,
78
82
  ) -> None: ...
79
83
  def is_retryable(self, context: Any) -> bool: ...
80
84
 
81
85
  class ThrottledRetryableChecker(BaseRetryableChecker):
82
- def __init__(self, throttled_error_codes: Optional[Sequence[str]] = ...) -> None: ...
86
+ def __init__(self, throttled_error_codes: Sequence[str] | None = ...) -> None: ...
83
87
  def is_retryable(self, context: Any) -> bool: ...
84
88
 
85
89
  class ModeledRetryableChecker(BaseRetryableChecker):
@@ -104,6 +108,6 @@ class OrRetryChecker(BaseRetryableChecker):
104
108
  def is_retryable(self, context: Any) -> Any: ...
105
109
 
106
110
  class RetryQuotaChecker:
107
- def __init__(self, quota: Any) -> None: ...
111
+ def __init__(self, quota: Any) -> None: ... # noqa: F811
108
112
  def acquire_retry_quota(self, context: Any) -> bool: ...
109
113
  def release_retry_quota(self, context: Any, http_response: Any, **kwargs: Any) -> None: ...
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any, NamedTuple
2
6
 
3
7
  class CubicParams(NamedTuple):
@@ -1,5 +1,9 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Type
6
+ from typing import Any, Callable, Iterable, Mapping
3
7
 
4
8
  from botocore.config import Config
5
9
  from botocore.exceptions import BotoCoreError
@@ -11,18 +15,18 @@ from botocore.exceptions import ReadTimeoutError as ReadTimeoutError
11
15
 
12
16
  logger: Logger = ...
13
17
 
14
- EXCEPTION_MAP: Dict[str, List[Type[BotoCoreError]]]
18
+ EXCEPTION_MAP: dict[str, list[type[BotoCoreError]]]
15
19
 
16
20
  def delay_exponential(base: float, growth_factor: float, attempts: int) -> float: ...
17
21
  def create_exponential_delay_function(
18
22
  base: float, growth_factor: float
19
23
  ) -> Callable[[int], float]: ...
20
- def create_retry_handler(config: Config, operation_name: Optional[str] = ...) -> RetryHandler: ...
24
+ def create_retry_handler(config: Config, operation_name: str | None = ...) -> RetryHandler: ...
21
25
  def create_retry_action_from_config(
22
- config: Config, operation_name: Optional[str] = ...
26
+ config: Config, operation_name: str | None = ...
23
27
  ) -> Callable[[int], float]: ...
24
28
  def create_checker_from_retry_config(
25
- config: Config, operation_name: Optional[str] = ...
29
+ config: Config, operation_name: str | None = ...
26
30
  ) -> MaxAttemptsDecorator: ...
27
31
 
28
32
  class RetryHandler:
@@ -41,7 +45,7 @@ class MaxAttemptsDecorator(BaseChecker):
41
45
  self,
42
46
  checker: BaseChecker,
43
47
  max_attempts: int,
44
- retryable_exceptions: Optional[Iterable[Type[Exception]]] = ...,
48
+ retryable_exceptions: Iterable[type[Exception]] | None = ...,
45
49
  ) -> None: ...
46
50
  # FIXME: Signature of "__call__" incompatible with supertype "BaseChecker"
47
51
  def __call__( # type: ignore [override]