boto3-stubs 1.35.36__py3-none-any.whl → 1.35.90__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. boto3-stubs/__init__.pyi +5905 -3987
  2. boto3-stubs/compat.pyi +7 -2
  3. boto3-stubs/crt.pyi +10 -6
  4. boto3-stubs/docs/__init__.pyi +6 -0
  5. boto3-stubs/docs/action.pyi +7 -3
  6. boto3-stubs/docs/attr.pyi +6 -0
  7. boto3-stubs/docs/base.pyi +8 -2
  8. boto3-stubs/docs/client.pyi +6 -0
  9. boto3-stubs/docs/collection.pyi +6 -0
  10. boto3-stubs/docs/docstring.pyi +6 -0
  11. boto3-stubs/docs/method.pyi +14 -8
  12. boto3-stubs/docs/resource.pyi +6 -0
  13. boto3-stubs/docs/service.pyi +6 -2
  14. boto3-stubs/docs/subresource.pyi +6 -0
  15. boto3-stubs/docs/utils.pyi +10 -4
  16. boto3-stubs/docs/waiter.pyi +6 -0
  17. boto3-stubs/dynamodb/conditions.pyi +31 -38
  18. boto3-stubs/dynamodb/table.pyi +15 -9
  19. boto3-stubs/dynamodb/transform.pyi +18 -12
  20. boto3-stubs/dynamodb/types.pyi +22 -33
  21. boto3-stubs/ec2/createtags.pyi +9 -3
  22. boto3-stubs/ec2/deletetags.pyi +6 -0
  23. boto3-stubs/exceptions.pyi +6 -0
  24. boto3-stubs/resources/action.pyi +12 -6
  25. boto3-stubs/resources/base.pyi +16 -12
  26. boto3-stubs/resources/collection.pyi +10 -6
  27. boto3-stubs/resources/factory.pyi +9 -3
  28. boto3-stubs/resources/model.pyi +55 -53
  29. boto3-stubs/resources/params.pyi +12 -6
  30. boto3-stubs/resources/response.pyi +20 -14
  31. boto3-stubs/s3/constants.pyi +6 -0
  32. boto3-stubs/s3/inject.pyi +62 -56
  33. boto3-stubs/s3/transfer.pyi +23 -17
  34. boto3-stubs/session.pyi +5920 -3986
  35. boto3-stubs/utils.pyi +10 -4
  36. {boto3_stubs-1.35.36.dist-info → boto3_stubs-1.35.90.dist-info}/METADATA +213 -81
  37. boto3_stubs-1.35.90.dist-info/RECORD +45 -0
  38. {boto3_stubs-1.35.36.dist-info → boto3_stubs-1.35.90.dist-info}/WHEEL +1 -1
  39. boto3_stubs-1.35.36.dist-info/RECORD +0 -45
  40. {boto3_stubs-1.35.36.dist-info → boto3_stubs-1.35.90.dist-info}/LICENSE +0 -0
  41. {boto3_stubs-1.35.36.dist-info → boto3_stubs-1.35.90.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for boto3.resources.collection module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
- from typing import Any, Iterator, List, TypeVar
8
+ from typing import Any, Iterator, TypeVar
3
9
 
4
10
  from boto3.resources.base import ServiceResource
5
11
  from boto3.resources.factory import ResourceFactory
@@ -10,15 +16,14 @@ from botocore.hooks import BaseEventHooks
10
16
 
11
17
  logger: logging.Logger
12
18
 
13
- _ResourceCollection = TypeVar("_ResourceCollection", bound="ResourceCollection")
19
+ _ResourceCollection = TypeVar("_ResourceCollection", bound=ResourceCollection)
14
20
 
15
21
  class ResourceCollection:
16
22
  def __init__(
17
23
  self, model: Collection, parent: ServiceResource, handler: ResourceHandler, **kwargs: Any
18
24
  ) -> None: ...
19
- def __repr__(self) -> str: ...
20
25
  def __iter__(self) -> Iterator[Any]: ...
21
- def pages(self) -> Iterator[List[Any]]: ...
26
+ def pages(self) -> Iterator[list[Any]]: ...
22
27
  def all(self: _ResourceCollection) -> _ResourceCollection: ...
23
28
  def filter(self: _ResourceCollection, **kwargs: Any) -> _ResourceCollection: ...
24
29
  def limit(self: _ResourceCollection, count: int) -> _ResourceCollection: ...
@@ -32,13 +37,12 @@ class CollectionManager:
32
37
  factory: ResourceFactory,
33
38
  service_context: ServiceContext,
34
39
  ) -> None: ...
35
- def __repr__(self) -> str: ...
36
40
  def iterator(self, **kwargs: Any) -> ResourceCollection: ...
37
41
  def all(self) -> ResourceCollection: ...
38
42
  def filter(self, **kwargs: Any) -> ResourceCollection: ...
39
43
  def limit(self, count: int) -> ResourceCollection: ...
40
44
  def page_size(self, count: InterruptedError) -> ResourceCollection: ...
41
- def pages(self) -> List[ServiceResource]: ...
45
+ def pages(self) -> list[ServiceResource]: ...
42
46
 
43
47
  class CollectionFactory:
44
48
  def load_from_definition(
@@ -1,5 +1,11 @@
1
+ """
2
+ Type annotations for boto3.resources.factory module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
- from typing import Any, Dict, Type
8
+ from typing import Any
3
9
 
4
10
  from boto3.resources.base import ServiceResource
5
11
  from boto3.utils import ServiceContext
@@ -12,6 +18,6 @@ class ResourceFactory:
12
18
  def load_from_definition(
13
19
  self,
14
20
  resource_name: str,
15
- single_resource_json_definition: Dict[str, Any],
21
+ single_resource_json_definition: dict[str, Any],
16
22
  service_context: ServiceContext,
17
- ) -> Type[ServiceResource]: ...
23
+ ) -> type[ServiceResource]: ...
@@ -1,69 +1,71 @@
1
+ """
2
+ Type annotations for boto3.resources.model module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
- import sys
3
- from typing import Any, Dict, List, Optional, Tuple, Union
8
+ from typing import Any, Literal, TypedDict
4
9
 
5
10
  from botocore.model import Shape
6
11
 
7
- if sys.version_info >= (3, 12):
8
- from typing import Literal
9
- else:
10
- from typing_extensions import Literal
11
- if sys.version_info >= (3, 12):
12
- from typing import TypedDict
13
- else:
14
- from typing_extensions import TypedDict
15
-
16
12
  logger: logging.Logger
17
13
 
18
- _ActionDefinition = TypedDict(
19
- "_ActionDefinition",
20
- {"request": Dict[str, Any], "resource": Dict[str, Any], "path": str},
21
- total=False,
22
- )
23
- _DefinitionWithParamsDefinition = TypedDict(
24
- "_DefinitionWithParamsDefinition", {"params": List[Dict[str, Any]]}, total=False
25
- )
26
- _RequestDefinition = TypedDict("_RequestDefinition", {"operation": str}, total=False)
27
- _WaiterDefinition = TypedDict("_WaiterDefinition", {"waiterName": str}, total=False)
28
- _ResponseResourceDefinition = TypedDict(
29
- "_ResponseResourceDefinition", {"type": str, "path": str}, total=False
30
- )
31
- _ResourceModelDefinition = TypedDict("_ResourceModelDefinition", {"shape": str}, total=False)
14
+ class _ActionDefinition(TypedDict, total=False):
15
+ request: dict[str, Any]
16
+ resource: dict[str, Any]
17
+ path: str
18
+
19
+ class _DefinitionWithParamsDefinition(TypedDict, total=False):
20
+ params: list[dict[str, Any]]
21
+
22
+ class _RequestDefinition(TypedDict, total=False):
23
+ operation: str
24
+
25
+ class _WaiterDefinition(TypedDict, total=False):
26
+ waiterName: str
27
+
28
+ class _ResponseResourceDefinition(TypedDict, total=False):
29
+ type: str
30
+ path: str
31
+
32
+ class _ResourceModelDefinition(TypedDict, total=False):
33
+ shape: str
32
34
 
33
35
  class Identifier:
34
- def __init__(self, name: str, member_name: Optional[str] = ...) -> None:
36
+ def __init__(self, name: str, member_name: str | None = ...) -> None:
35
37
  self.name: str
36
38
  self.member_name: str
37
39
 
38
40
  class Action:
39
41
  def __init__(
40
- self, name: str, definition: _ActionDefinition, resource_defs: Dict[str, Dict[str, Any]]
42
+ self, name: str, definition: _ActionDefinition, resource_defs: dict[str, dict[str, Any]]
41
43
  ) -> None:
42
44
  self.name: str
43
- self.request: Optional[Request]
44
- self.resource: Optional[ResponseResource]
45
- self.path: Optional[str]
45
+ self.request: Request | None
46
+ self.resource: ResponseResource | None
47
+ self.path: str | None
46
48
 
47
49
  class DefinitionWithParams:
48
50
  def __init__(self, definition: _DefinitionWithParamsDefinition) -> None: ...
49
51
  @property
50
- def params(self) -> List[Parameter]: ...
52
+ def params(self) -> list[Parameter]: ...
51
53
 
52
54
  class Parameter:
53
55
  def __init__(
54
56
  self,
55
57
  target: str,
56
58
  source: str,
57
- name: Optional[str] = ...,
58
- path: Optional[str] = ...,
59
- value: Union[str, int, float, bool, None] = ...,
59
+ name: str | None = ...,
60
+ path: str | None = ...,
61
+ value: str | float | bool | None = ...,
60
62
  **kwargs: Any,
61
63
  ) -> None:
62
64
  self.target: str
63
65
  self.source: str
64
- self.name: Optional[str]
65
- self.path: Optional[str]
66
- self.value: Union[str, int, float, bool, None]
66
+ self.name: str | None
67
+ self.path: str | None
68
+ self.value: str | int | float | bool | None
67
69
 
68
70
  class Request(DefinitionWithParams):
69
71
  def __init__(self, definition: _RequestDefinition) -> None:
@@ -77,45 +79,45 @@ class Waiter(DefinitionWithParams):
77
79
 
78
80
  class ResponseResource:
79
81
  def __init__(
80
- self, definition: _ResponseResourceDefinition, resource_defs: Dict[str, Dict[str, Any]]
82
+ self, definition: _ResponseResourceDefinition, resource_defs: dict[str, dict[str, Any]]
81
83
  ) -> None:
82
84
  self.type: str
83
85
  self.path: str
84
86
 
85
87
  @property
86
- def identifiers(self) -> List[Identifier]: ...
88
+ def identifiers(self) -> list[Identifier]: ...
87
89
  @property
88
- def model(self) -> "ResourceModel": ...
90
+ def model(self) -> ResourceModel: ...
89
91
 
90
92
  class Collection(Action):
91
93
  @property
92
- def batch_actions(self) -> List[Action]: ...
94
+ def batch_actions(self) -> list[Action]: ...
93
95
 
94
96
  class ResourceModel:
95
97
  def __init__(
96
98
  self,
97
99
  name: str,
98
100
  definition: _ResourceModelDefinition,
99
- resource_defs: Dict[str, Dict[str, Any]],
101
+ resource_defs: dict[str, dict[str, Any]],
100
102
  ) -> None:
101
103
  self.name: str
102
- self.shape: Optional[str]
104
+ self.shape: str | None
103
105
 
104
- def load_rename_map(self, shape: Optional[Shape] = ...) -> None: ...
105
- def get_attributes(self, shape: Shape) -> Dict[str, Tuple[str, Shape]]: ...
106
+ def load_rename_map(self, shape: Shape | None = ...) -> None: ...
107
+ def get_attributes(self, shape: Shape) -> dict[str, tuple[str, Shape]]: ...
106
108
  @property
107
- def identifiers(self) -> List[Identifier]: ...
109
+ def identifiers(self) -> list[Identifier]: ...
108
110
  @property
109
- def load(self) -> Optional[Action]: ...
111
+ def load(self) -> Action | None: ...
110
112
  @property
111
- def actions(self) -> List[Action]: ...
113
+ def actions(self) -> list[Action]: ...
112
114
  @property
113
- def batch_actions(self) -> List[Action]: ...
115
+ def batch_actions(self) -> list[Action]: ...
114
116
  @property
115
- def subresources(self) -> List[ResponseResource]: ...
117
+ def subresources(self) -> list[ResponseResource]: ...
116
118
  @property
117
- def references(self) -> List[Action]: ...
119
+ def references(self) -> list[Action]: ...
118
120
  @property
119
- def collections(self) -> List[Collection]: ...
121
+ def collections(self) -> list[Collection]: ...
120
122
  @property
121
- def waiters(self) -> List[Waiter]: ...
123
+ def waiters(self) -> list[Waiter]: ...
@@ -1,17 +1,23 @@
1
- from typing import Any, Dict, Optional, Pattern
1
+ """
2
+ Type annotations for boto3.resources.params module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Pattern
2
8
 
3
9
  from boto3.resources.base import ServiceResource
4
10
  from boto3.resources.model import Request
5
11
 
6
12
  INDEX_RE: Pattern[str]
7
13
 
8
- def get_data_member(parent: ServiceResource, path: str) -> Optional[Dict[str, Any]]: ...
14
+ def get_data_member(parent: ServiceResource, path: str) -> dict[str, Any] | None: ...
9
15
  def create_request_parameters(
10
16
  parent: ServiceResource,
11
17
  request_model: Request,
12
- params: Optional[Dict[str, Any]] = ...,
13
- index: Optional[int] = ...,
14
- ) -> Dict[str, Any]: ...
18
+ params: dict[str, Any] | None = ...,
19
+ index: int | None = ...,
20
+ ) -> dict[str, Any]: ...
15
21
  def build_param_structure(
16
- params: Dict[str, Any], target: str, value: Any, index: Optional[int] = ...
22
+ params: dict[str, Any], target: str, value: Any, index: int | None = ...
17
23
  ) -> None: ...
@@ -1,4 +1,10 @@
1
- from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union
1
+ """
2
+ Type annotations for boto3.resources.response module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Iterable
2
8
 
3
9
  from boto3.resources.base import ServiceResource
4
10
  from boto3.resources.factory import ResourceFactory
@@ -8,20 +14,20 @@ from botocore.model import ServiceModel
8
14
 
9
15
  def all_not_none(iterable: Iterable[Any]) -> bool: ...
10
16
  def build_identifiers(
11
- identifiers: List[Parameter],
17
+ identifiers: list[Parameter],
12
18
  parent: ServiceResource,
13
- params: Optional[Dict[str, Any]] = ...,
14
- raw_response: Optional[Dict[str, Any]] = ...,
15
- ) -> List[Tuple[str, Any]]: ...
19
+ params: dict[str, Any] | None = ...,
20
+ raw_response: dict[str, Any] | None = ...,
21
+ ) -> list[tuple[str, Any]]: ...
16
22
  def build_empty_response(
17
23
  search_path: str, operation_name: str, service_model: ServiceModel
18
- ) -> Union[Dict[str, Any], List[Any], None]: ...
24
+ ) -> dict[str, Any] | list[Any] | None: ...
19
25
 
20
26
  class RawHandler:
21
27
  def __init__(self, search_path: str) -> None: ...
22
28
  def __call__(
23
- self, parent: ServiceResource, params: Dict[str, Any], response: Dict[str, Any]
24
- ) -> Dict[str, Any]: ...
29
+ self, parent: ServiceResource, params: dict[str, Any], response: dict[str, Any]
30
+ ) -> dict[str, Any]: ...
25
31
 
26
32
  class ResourceHandler:
27
33
  def __init__(
@@ -30,15 +36,15 @@ class ResourceHandler:
30
36
  factory: ResourceFactory,
31
37
  resource_model: ResponseResource,
32
38
  service_context: ServiceContext,
33
- operation_name: Optional[str] = ...,
39
+ operation_name: str | None = ...,
34
40
  ) -> None: ...
35
41
  def __call__(
36
- self, parent: ServiceResource, params: Dict[str, Any], response: Dict[str, Any]
37
- ) -> Union[ServiceResource, List[ServiceResource]]: ...
42
+ self, parent: ServiceResource, params: dict[str, Any], response: dict[str, Any]
43
+ ) -> ServiceResource | list[ServiceResource]: ...
38
44
  def handle_response_item(
39
45
  self,
40
- resource_cls: Type[ServiceResource],
46
+ resource_cls: type[ServiceResource],
41
47
  parent: ServiceResource,
42
- identifiers: Dict[str, Any],
43
- resource_data: Optional[Dict[str, Any]],
48
+ identifiers: dict[str, Any],
49
+ resource_data: dict[str, Any] | None,
44
50
  ) -> ServiceResource: ...
@@ -1,2 +1,8 @@
1
+ """
2
+ Type annotations for boto3.s3.constants module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  CLASSIC_TRANSFER_CLIENT: str = ...
2
8
  AUTO_RESOLVE_TRANSFER_CLIENT: str = ...
boto3-stubs/s3/inject.pyi CHANGED
@@ -1,4 +1,10 @@
1
- from typing import IO, Any, Callable, Dict, Optional
1
+ """
2
+ Type annotations for boto3.s3.inject module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import IO, Any, Callable
2
8
 
3
9
  from boto3 import utils as utils
4
10
  from boto3.s3.transfer import ProgressCallbackInvoker as ProgressCallbackInvoker
@@ -8,10 +14,10 @@ from boto3.s3.transfer import create_transfer_manager as create_transfer_manager
8
14
  from botocore.client import BaseClient
9
15
  from botocore.exceptions import ClientError as ClientError
10
16
 
11
- def inject_s3_transfer_methods(class_attributes: Dict[str, Any], **kwargs: Any) -> None: ...
12
- def inject_bucket_methods(class_attributes: Dict[str, Any], **kwargs: Any) -> None: ...
13
- def inject_object_methods(class_attributes: Dict[str, Any], **kwargs: Any) -> None: ...
14
- def inject_object_summary_methods(class_attributes: Dict[str, Any], **kwargs: Any) -> None: ...
17
+ def inject_s3_transfer_methods(class_attributes: dict[str, Any], **kwargs: Any) -> None: ...
18
+ def inject_bucket_methods(class_attributes: dict[str, Any], **kwargs: Any) -> None: ...
19
+ def inject_object_methods(class_attributes: dict[str, Any], **kwargs: Any) -> None: ...
20
+ def inject_object_summary_methods(class_attributes: dict[str, Any], **kwargs: Any) -> None: ...
15
21
  def bucket_load(self: Any, *args: Any, **kwargs: Any) -> None: ...
16
22
  def object_summary_load(self: Any, *args: Any, **kwargs: Any) -> None: ...
17
23
  def upload_file(
@@ -19,121 +25,121 @@ def upload_file(
19
25
  Filename: str,
20
26
  Bucket: str,
21
27
  Key: str,
22
- ExtraArgs: Optional[Dict[str, Any]] = ...,
23
- Callback: Optional[Callable[..., Any]] = ...,
24
- Config: Optional[TransferConfig] = ...,
28
+ ExtraArgs: dict[str, Any] | None = ...,
29
+ Callback: Callable[..., Any] | None = ...,
30
+ Config: TransferConfig | None = ...,
25
31
  ) -> None: ...
26
32
  def download_file(
27
33
  self: Any,
28
34
  Bucket: str,
29
35
  Key: str,
30
36
  Filename: str,
31
- ExtraArgs: Optional[Dict[str, Any]] = ...,
32
- Callback: Optional[Callable[..., Any]] = ...,
33
- Config: Optional[TransferConfig] = ...,
37
+ ExtraArgs: dict[str, Any] | None = ...,
38
+ Callback: Callable[..., Any] | None = ...,
39
+ Config: TransferConfig | None = ...,
34
40
  ) -> None: ...
35
41
  def bucket_upload_file(
36
42
  self: Any,
37
43
  Filename: str,
38
44
  Key: str,
39
- ExtraArgs: Optional[Dict[str, Any]] = ...,
40
- Callback: Optional[Callable[..., Any]] = ...,
41
- Config: Optional[TransferConfig] = ...,
45
+ ExtraArgs: dict[str, Any] | None = ...,
46
+ Callback: Callable[..., Any] | None = ...,
47
+ Config: TransferConfig | None = ...,
42
48
  ) -> None: ...
43
49
  def bucket_download_file(
44
50
  self: Any,
45
51
  Key: str,
46
52
  Filename: str,
47
- ExtraArgs: Optional[Dict[str, Any]] = ...,
48
- Callback: Optional[Callable[..., Any]] = ...,
49
- Config: Optional[TransferConfig] = ...,
53
+ ExtraArgs: dict[str, Any] | None = ...,
54
+ Callback: Callable[..., Any] | None = ...,
55
+ Config: TransferConfig | None = ...,
50
56
  ) -> None: ...
51
57
  def object_upload_file(
52
58
  self: Any,
53
59
  Filename: str,
54
- ExtraArgs: Optional[Dict[str, Any]] = ...,
55
- Callback: Optional[Callable[..., Any]] = ...,
56
- Config: Optional[TransferConfig] = ...,
60
+ ExtraArgs: dict[str, Any] | None = ...,
61
+ Callback: Callable[..., Any] | None = ...,
62
+ Config: TransferConfig | None = ...,
57
63
  ) -> None: ...
58
64
  def object_download_file(
59
65
  self: Any,
60
66
  Filename: str,
61
- ExtraArgs: Optional[Dict[str, Any]] = ...,
62
- Callback: Optional[Callable[..., Any]] = ...,
63
- Config: Optional[TransferConfig] = ...,
67
+ ExtraArgs: dict[str, Any] | None = ...,
68
+ Callback: Callable[..., Any] | None = ...,
69
+ Config: TransferConfig | None = ...,
64
70
  ) -> None: ...
65
71
  def copy(
66
72
  self: Any,
67
- CopySource: Dict[str, Any],
73
+ CopySource: dict[str, Any],
68
74
  Bucket: str,
69
75
  Key: str,
70
- ExtraArgs: Optional[Dict[str, Any]] = ...,
71
- Callback: Optional[Callable[..., Any]] = ...,
72
- SourceClient: Optional[BaseClient] = ...,
73
- Config: Optional[TransferConfig] = ...,
76
+ ExtraArgs: dict[str, Any] | None = ...,
77
+ Callback: Callable[..., Any] | None = ...,
78
+ SourceClient: BaseClient | None = ...,
79
+ Config: TransferConfig | None = ...,
74
80
  ) -> None: ...
75
81
  def bucket_copy(
76
82
  self: Any,
77
- CopySource: Dict[str, Any],
83
+ CopySource: dict[str, Any],
78
84
  Key: str,
79
- ExtraArgs: Optional[Dict[str, Any]] = ...,
80
- Callback: Optional[Callable[..., Any]] = ...,
81
- SourceClient: Optional[BaseClient] = ...,
82
- Config: Optional[TransferConfig] = ...,
85
+ ExtraArgs: dict[str, Any] | None = ...,
86
+ Callback: Callable[..., Any] | None = ...,
87
+ SourceClient: BaseClient | None = ...,
88
+ Config: TransferConfig | None = ...,
83
89
  ) -> None: ...
84
90
  def object_copy(
85
91
  self: Any,
86
- CopySource: Dict[str, Any],
87
- ExtraArgs: Optional[Dict[str, Any]] = ...,
88
- Callback: Optional[Callable[..., Any]] = ...,
89
- SourceClient: Optional[BaseClient] = ...,
90
- Config: Optional[TransferConfig] = ...,
92
+ CopySource: dict[str, Any],
93
+ ExtraArgs: dict[str, Any] | None = ...,
94
+ Callback: Callable[..., Any] | None = ...,
95
+ SourceClient: BaseClient | None = ...,
96
+ Config: TransferConfig | None = ...,
91
97
  ) -> None: ...
92
98
  def upload_fileobj(
93
99
  self: Any,
94
100
  Fileobj: IO[Any],
95
101
  Bucket: str,
96
102
  Key: str,
97
- ExtraArgs: Optional[Dict[str, Any]] = ...,
98
- Callback: Optional[Callable[..., Any]] = ...,
99
- Config: Optional[TransferConfig] = ...,
103
+ ExtraArgs: dict[str, Any] | None = ...,
104
+ Callback: Callable[..., Any] | None = ...,
105
+ Config: TransferConfig | None = ...,
100
106
  ) -> None: ...
101
107
  def bucket_upload_fileobj(
102
108
  self: Any,
103
109
  Fileobj: IO[Any],
104
110
  Key: str,
105
- ExtraArgs: Optional[Dict[str, Any]] = ...,
106
- Callback: Optional[Callable[..., Any]] = ...,
107
- Config: Optional[TransferConfig] = ...,
111
+ ExtraArgs: dict[str, Any] | None = ...,
112
+ Callback: Callable[..., Any] | None = ...,
113
+ Config: TransferConfig | None = ...,
108
114
  ) -> None: ...
109
115
  def object_upload_fileobj(
110
116
  self: Any,
111
117
  Fileobj: IO[Any],
112
- ExtraArgs: Optional[Dict[str, Any]] = ...,
113
- Callback: Optional[Callable[..., Any]] = ...,
114
- Config: Optional[TransferConfig] = ...,
118
+ ExtraArgs: dict[str, Any] | None = ...,
119
+ Callback: Callable[..., Any] | None = ...,
120
+ Config: TransferConfig | None = ...,
115
121
  ) -> None: ...
116
122
  def download_fileobj(
117
123
  self: Any,
118
124
  Bucket: str,
119
125
  Key: str,
120
126
  Fileobj: IO[Any],
121
- ExtraArgs: Optional[Dict[str, Any]] = ...,
122
- Callback: Optional[Callable[..., Any]] = ...,
123
- Config: Optional[TransferConfig] = ...,
127
+ ExtraArgs: dict[str, Any] | None = ...,
128
+ Callback: Callable[..., Any] | None = ...,
129
+ Config: TransferConfig | None = ...,
124
130
  ) -> None: ...
125
131
  def bucket_download_fileobj(
126
132
  self: Any,
127
133
  Key: str,
128
134
  Fileobj: IO[Any],
129
- ExtraArgs: Optional[Dict[str, Any]] = ...,
130
- Callback: Optional[Callable[..., Any]] = ...,
131
- Config: Optional[TransferConfig] = ...,
135
+ ExtraArgs: dict[str, Any] | None = ...,
136
+ Callback: Callable[..., Any] | None = ...,
137
+ Config: TransferConfig | None = ...,
132
138
  ) -> None: ...
133
139
  def object_download_fileobj(
134
140
  self: Any,
135
141
  Fileobj: IO[Any],
136
- ExtraArgs: Optional[Dict[str, Any]] = ...,
137
- Callback: Optional[Callable[..., Any]] = ...,
138
- Config: Optional[TransferConfig] = ...,
142
+ ExtraArgs: dict[str, Any] | None = ...,
143
+ Callback: Callable[..., Any] | None = ...,
144
+ Config: TransferConfig | None = ...,
139
145
  ) -> None: ...
@@ -1,6 +1,12 @@
1
+ """
2
+ Type annotations for boto3.s3.transfer module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import logging
2
8
  from types import TracebackType
3
- from typing import Any, Callable, Dict, List, Mapping, Optional, Type, TypeVar
9
+ from typing import Any, Callable, Mapping, TypeVar
4
10
 
5
11
  from botocore.client import BaseClient
6
12
  from botocore.config import Config
@@ -19,12 +25,12 @@ logger: logging.Logger = ...
19
25
  def create_transfer_manager(
20
26
  client: BaseClient,
21
27
  config: TransferConfig,
22
- osutil: Optional[OSUtils] = ...,
28
+ osutil: OSUtils | None = ...,
23
29
  ) -> TransferManager: ...
24
30
  def has_minimum_crt_version(minimum_version: str) -> bool: ...
25
31
 
26
32
  class TransferConfig(S3TransferConfig):
27
- ALIAS: Dict[str, str]
33
+ ALIAS: dict[str, str]
28
34
 
29
35
  def __init__(
30
36
  self,
@@ -35,7 +41,7 @@ class TransferConfig(S3TransferConfig):
35
41
  max_io_queue: int = ...,
36
42
  io_chunksize: int = ...,
37
43
  use_threads: bool = ...,
38
- max_bandwidth: Optional[int] = ...,
44
+ max_bandwidth: int | None = ...,
39
45
  preferred_transfer_client: str = ...,
40
46
  ) -> None:
41
47
  self.use_threads: bool
@@ -43,37 +49,37 @@ class TransferConfig(S3TransferConfig):
43
49
  def __setattr__(self, name: str, value: int) -> None: ...
44
50
 
45
51
  class S3Transfer:
46
- ALLOWED_DOWNLOAD_ARGS: List[str]
47
- ALLOWED_UPLOAD_ARGS: List[str]
52
+ ALLOWED_DOWNLOAD_ARGS: list[str]
53
+ ALLOWED_UPLOAD_ARGS: list[str]
48
54
  def __init__(
49
55
  self,
50
- client: Optional[BaseClient] = ...,
51
- config: Optional[Config] = ...,
52
- osutil: Optional[OSUtils] = ...,
53
- manager: Optional[TransferManager] = ...,
56
+ client: BaseClient | None = ...,
57
+ config: Config | None = ...,
58
+ osutil: OSUtils | None = ...,
59
+ manager: TransferManager | None = ...,
54
60
  ) -> None: ...
55
61
  def upload_file(
56
62
  self,
57
63
  filename: str,
58
64
  bucket: str,
59
65
  key: str,
60
- callback: Optional[Callable[[int], Any]] = ...,
61
- extra_args: Optional[Mapping[str, Any]] = ...,
66
+ callback: Callable[[int], Any] | None = ...,
67
+ extra_args: Mapping[str, Any] | None = ...,
62
68
  ) -> None: ...
63
69
  def download_file(
64
70
  self,
65
71
  bucket: str,
66
72
  key: str,
67
73
  filename: str,
68
- extra_args: Optional[Mapping[str, Any]] = ...,
69
- callback: Optional[Callable[[int], Any]] = ...,
74
+ extra_args: Mapping[str, Any] | None = ...,
75
+ callback: Callable[[int], Any] | None = ...,
70
76
  ) -> None: ...
71
77
  def __enter__(self: _R) -> _R: ...
72
78
  def __exit__(
73
79
  self,
74
- exc_type: Optional[Type[Exception]],
75
- exc_value: Optional[Exception],
76
- tb: Optional[TracebackType],
80
+ exc_type: type[BaseException] | None,
81
+ exc_value: BaseException | None,
82
+ tb: TracebackType | None,
77
83
  ) -> None: ...
78
84
 
79
85
  class ProgressCallbackInvoker(BaseSubscriber):