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,7 +1,12 @@
1
- import sys
2
- from collections.abc import MutableMapping
1
+ """
2
+ Type annotations for botocore.session module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from collections.abc import Callable, MutableMapping
3
8
  from logging import Logger
4
- from typing import IO, Any, Dict, Iterator, List, Mapping, Optional, Tuple, Union
9
+ from typing import IO, Any, Iterator, Mapping, Protocol, Sequence
5
10
 
6
11
  from botocore.client import BaseClient, Config
7
12
  from botocore.compat import HAS_CRT as HAS_CRT
@@ -33,20 +38,13 @@ from botocore.utils import EVENT_ALIASES as EVENT_ALIASES
33
38
  from botocore.utils import validate_region_name as validate_region_name
34
39
  from botocore.waiter import WaiterModel
35
40
 
36
- if sys.version_info >= (3, 9):
37
- from typing import Protocol
38
- else:
39
- from typing_extensions import Protocol
40
-
41
41
  logger: Logger = ...
42
42
 
43
- _EnvDict = Dict[str, Tuple[Any, Any, Any, Any]]
44
-
45
43
  class _EventHandler(Protocol):
46
44
  def __call__(self, **kwargs: Any) -> None: ...
47
45
 
48
46
  class Session:
49
- SESSION_VARIABLES: _EnvDict
47
+ SESSION_VARIABLES: dict[str, tuple[Any, Any, Any, Any]]
50
48
  LOG_FORMAT: str
51
49
  user_agent_name: str
52
50
  user_agent_version: str
@@ -54,96 +52,94 @@ class Session:
54
52
  session_var_map: SessionVarDict
55
53
  def __init__(
56
54
  self,
57
- session_vars: Optional[_EnvDict] = ...,
58
- event_hooks: Optional[BaseEventHooks] = ...,
55
+ session_vars: dict[str, tuple[Any, Any, Any, Any]] | None = ...,
56
+ event_hooks: BaseEventHooks | None = ...,
59
57
  include_builtin_handlers: bool = ...,
60
- profile: Optional[str] = ...,
58
+ profile: str | None = ...,
61
59
  ) -> None: ...
62
60
  @property
63
- def available_profiles(self) -> List[str]: ...
61
+ def available_profiles(self) -> list[str]: ...
64
62
  @property
65
- def profile(self) -> Optional[str]: ...
66
- def get_config_variable(self, logical_name: str, methods: Optional[Any] = ...) -> Any: ...
63
+ def profile(self) -> str | None: ...
64
+ def get_config_variable(self, logical_name: str, methods: Any | None = ...) -> Any: ...
67
65
  def set_config_variable(self, logical_name: str, value: Any) -> None: ...
68
- def instance_variables(self) -> Dict[str, Any]: ...
69
- def get_scoped_config(self) -> Dict[str, Any]: ...
66
+ def instance_variables(self) -> dict[str, Any]: ...
67
+ def get_scoped_config(self) -> dict[str, Any]: ...
70
68
  @property
71
- def full_config(self) -> Dict[str, Any]: ...
69
+ def full_config(self) -> dict[str, Any]: ...
72
70
  def get_default_client_config(self) -> Config: ...
73
71
  def set_default_client_config(self, client_config: Config) -> None: ...
74
72
  def set_credentials(
75
- self, access_key: str, secret_key: str, token: Optional[str] = ...
73
+ self, access_key: str, secret_key: str, token: str | None = ...
76
74
  ) -> None: ...
77
75
  def get_credentials(self) -> Credentials: ...
78
76
  def get_auth_token(self) -> FrozenAuthToken: ...
79
77
  def user_agent(self) -> str: ...
80
78
  def get_data(self, data_path: str) -> Any: ...
81
79
  def get_service_model(
82
- self, service_name: str, api_version: Optional[str] = ...
80
+ self, service_name: str, api_version: str | None = ...
83
81
  ) -> ServiceModel: ...
84
- def get_waiter_model(
85
- self, service_name: str, api_version: Optional[str] = ...
86
- ) -> WaiterModel: ...
82
+ def get_waiter_model(self, service_name: str, api_version: str | None = ...) -> WaiterModel: ...
87
83
  def get_paginator_model(
88
- self, service_name: str, api_version: Optional[str] = ...
84
+ self, service_name: str, api_version: str | None = ...
89
85
  ) -> PaginatorModel: ...
90
- def get_service_data(self, service_name: str, api_version: Optional[str] = ...) -> Any: ...
86
+ def get_service_data(self, service_name: str, api_version: str | None = ...) -> Any: ...
91
87
  def get_available_services(self) -> Any: ...
92
88
  def set_debug_logger(self, logger_name: str = ...) -> None: ...
93
89
  def set_stream_logger(
94
90
  self,
95
91
  logger_name: str,
96
92
  log_level: str,
97
- stream: Optional[IO[str]] = ...,
98
- format_string: Optional[str] = ...,
93
+ stream: IO[str] | None = ...,
94
+ format_string: str | None = ...,
99
95
  ) -> None: ...
100
96
  def set_file_logger(self, log_level: str, path: str, logger_name: str = ...) -> None: ...
101
97
  def register(
102
98
  self,
103
99
  event_name: str,
104
100
  handler: _EventHandler,
105
- unique_id: Optional[str] = ...,
101
+ unique_id: str | None = ...,
106
102
  unique_id_uses_count: bool = ...,
107
103
  ) -> None: ...
108
104
  def unregister(
109
105
  self,
110
106
  event_name: str,
111
- handler: Optional[_EventHandler] = ...,
112
- unique_id: Optional[str] = ...,
107
+ handler: _EventHandler | None = ...,
108
+ unique_id: str | None = ...,
113
109
  unique_id_uses_count: bool = ...,
114
110
  ) -> None: ...
115
111
  def emit(self, event_name: str, **kwargs: Any) -> Any: ...
116
- def emit_first_non_none_response(self, event_name: Any, **kwargs: Any) -> Any: ...
117
- def get_component(self, name: Any) -> Any: ...
118
- def register_component(self, name: Any, component: Any) -> None: ...
119
- def lazy_register_component(self, name: Any, component: Any) -> None: ...
112
+ def emit_first_non_none_response(self, event_name: str, **kwargs: Any) -> Any: ...
113
+ def get_component(self, name: str) -> Any: ...
114
+ def register_component(self, name: str, component: Any) -> None: ...
115
+ def lazy_register_component(self, name: str, component: Any) -> None: ...
120
116
  def create_client(
121
117
  self,
122
118
  service_name: str,
123
- region_name: Optional[str] = ...,
124
- api_version: Optional[str] = ...,
125
- use_ssl: Optional[bool] = ...,
126
- verify: Optional[Union[bool, str]] = ...,
127
- endpoint_url: Optional[str] = ...,
128
- aws_access_key_id: Optional[str] = ...,
129
- aws_secret_access_key: Optional[str] = ...,
130
- aws_session_token: Optional[str] = ...,
131
- config: Optional[Config] = ...,
119
+ region_name: str | None = ...,
120
+ api_version: str | None = ...,
121
+ use_ssl: bool | None = ...,
122
+ verify: bool | str | None = ...,
123
+ endpoint_url: str | None = ...,
124
+ aws_access_key_id: str | None = ...,
125
+ aws_secret_access_key: str | None = ...,
126
+ aws_session_token: str | None = ...,
127
+ config: Config | None = ...,
132
128
  ) -> BaseClient: ...
133
- def get_available_partitions(self) -> List[str]: ...
129
+ def get_available_partitions(self) -> list[str]: ...
134
130
  def get_partition_for_region(self, region_name: str) -> str: ...
135
131
  def get_available_regions(
136
132
  self,
137
133
  service_name: str,
138
134
  partition_name: str = ...,
139
135
  allow_non_regional: bool = ...,
140
- ) -> List[str]: ...
136
+ ) -> list[str]: ...
141
137
 
142
138
  class ComponentLocator:
143
139
  def __init__(self) -> None: ...
144
140
  def get_component(self, name: str) -> Any: ...
145
141
  def register_component(self, name: str, component: Any) -> None: ...
146
- def lazy_register_component(self, name: str, no_arg_factory: Any) -> None: ...
142
+ def lazy_register_component(self, name: str, no_arg_factory: Callable[[], Any]) -> None: ...
147
143
 
148
144
  class SessionVarDict(MutableMapping[str, Any]):
149
145
  def __init__(self, session: Session, session_vars: Mapping[str, Any]) -> None: ...
@@ -154,14 +150,16 @@ class SessionVarDict(MutableMapping[str, Any]):
154
150
  def __len__(self) -> int: ...
155
151
 
156
152
  class SubsetChainConfigFactory:
157
- def __init__(self, session: Session, methods: Any, environ: Optional[Any] = ...) -> None: ...
153
+ def __init__(
154
+ self, session: Session, methods: Sequence[str], environ: Any | None = ...
155
+ ) -> None: ...
158
156
  def create_config_chain(
159
157
  self,
160
- instance_name: Optional[Any] = ...,
161
- env_var_names: Optional[Any] = ...,
162
- config_property_name: Optional[Any] = ...,
163
- default: Optional[Any] = ...,
164
- conversion_func: Optional[Any] = ...,
158
+ instance_name: Any | None = ...,
159
+ env_var_names: Any | None = ...,
160
+ config_property_name: Any | None = ...,
161
+ default: Any | None = ...,
162
+ conversion_func: Any | None = ...,
165
163
  ) -> Any: ...
166
164
 
167
- def get_session(env_vars: Optional[_EnvDict] = ...) -> Session: ...
165
+ def get_session(env_vars: dict[str, tuple[Any, Any, Any, Any]] | None = ...) -> Session: ...
@@ -1,8 +1,15 @@
1
- from typing import Any, Mapping, Optional
1
+ """
2
+ Type annotations for botocore.signers module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, Mapping
2
8
 
3
9
  from botocore.awsrequest import create_request_object as create_request_object
4
10
  from botocore.awsrequest import prepare_request_dict as prepare_request_dict
5
11
  from botocore.compat import OrderedDict as OrderedDict
12
+ from botocore.credentials import Credentials, ReadOnlyCredentials
6
13
  from botocore.exceptions import UnknownClientMethodError as UnknownClientMethodError
7
14
  from botocore.exceptions import UnknownSignatureVersionError as UnknownSignatureVersionError
8
15
  from botocore.exceptions import UnsupportedSignatureVersionError as UnsupportedSignatureVersionError
@@ -17,9 +24,9 @@ class RequestSigner:
17
24
  region_name: str,
18
25
  signing_name: str,
19
26
  signature_version: str,
20
- credentials: Any,
27
+ credentials: Credentials | ReadOnlyCredentials,
21
28
  event_emitter: BaseEventHooks,
22
- auth_token: Optional[str] = ...,
29
+ auth_token: str | None = ...,
23
30
  ) -> None: ...
24
31
  @property
25
32
  def region_name(self) -> str: ...
@@ -28,22 +35,23 @@ class RequestSigner:
28
35
  @property
29
36
  def signing_name(self) -> str: ...
30
37
  def handler(
31
- self, operation_name: Optional[str] = ..., request: Optional[Any] = ..., **kwargs: Any
38
+ self, operation_name: str | None = ..., request: Any | None = ..., **kwargs: Any
32
39
  ) -> Any: ...
33
40
  def sign(
34
41
  self,
35
42
  operation_name: str,
36
43
  request: Any,
37
- region_name: Optional[str] = ...,
44
+ region_name: str | None = ...,
38
45
  signing_type: str = ...,
39
- expires_in: Optional[Any] = ...,
40
- signing_name: Optional[str] = ...,
46
+ expires_in: Any | None = ...,
47
+ signing_name: str | None = ...,
41
48
  ) -> None: ...
42
49
  def get_auth_instance(
43
50
  self,
44
51
  signing_name: str,
45
52
  region_name: str,
46
- signature_version: Optional[str] = ...,
53
+ signature_version: str | None = ...,
54
+ request_credentials: Credentials | ReadOnlyCredentials | None = ...,
47
55
  **kwargs: Any,
48
56
  ) -> Any: ...
49
57
  get_auth: Any = ...
@@ -52,8 +60,8 @@ class RequestSigner:
52
60
  request_dict: Mapping[str, Any],
53
61
  operation_name: str,
54
62
  expires_in: int = ...,
55
- region_name: Optional[str] = ...,
56
- signing_name: Optional[str] = ...,
63
+ region_name: str | None = ...,
64
+ signing_name: str | None = ...,
57
65
  ) -> Any: ...
58
66
 
59
67
  class CloudFrontSigner:
@@ -61,46 +69,55 @@ class CloudFrontSigner:
61
69
  rsa_signer: Any = ...
62
70
  def __init__(self, key_id: str, rsa_signer: Any) -> None: ...
63
71
  def generate_presigned_url(
64
- self, url: str, date_less_than: Optional[Any] = ..., policy: Optional[Any] = ...
65
- ) -> Any: ...
72
+ self, url: str, date_less_than: Any | None = ..., policy: Any | None = ...
73
+ ) -> str: ...
66
74
  def build_policy(
67
75
  self,
68
76
  resource: Any,
69
77
  date_less_than: Any,
70
- date_greater_than: Optional[Any] = ...,
71
- ip_address: Optional[Any] = ...,
72
- ) -> Any: ...
78
+ date_greater_than: Any | None = ...,
79
+ ip_address: Any | None = ...,
80
+ ) -> str: ...
73
81
 
74
82
  def add_generate_db_auth_token(class_attributes: Any, **kwargs: Any) -> None: ...
83
+ def add_dsql_generate_db_auth_token_methods(
84
+ class_attributes: dict[str, Any], **kwargs: Any
85
+ ) -> None: ...
75
86
  def generate_db_auth_token(
76
- self: Any, DBHostname: Any, Port: Any, DBUsername: Any, Region: Optional[Any] = ...
87
+ self: Any, DBHostname: Any, Port: Any, DBUsername: Any, Region: Any | None = ...
77
88
  ) -> Any: ...
89
+ def dsql_generate_db_connect_auth_token(
90
+ self: Any, Hostname: str, Region: str | None = ..., ExpiresIn: int = ...
91
+ ) -> str: ...
92
+ def dsql_generate_db_connect_admin_auth_token(
93
+ self: Any, Hostname: str, Region: str | None = ..., ExpiresIn: int = ...
94
+ ) -> str: ...
78
95
 
79
96
  class S3PostPresigner:
80
97
  def __init__(self, request_signer: Any) -> None: ...
81
98
  def generate_presigned_post(
82
99
  self,
83
100
  request_dict: Mapping[str, Any],
84
- fields: Optional[Any] = ...,
85
- conditions: Optional[Any] = ...,
101
+ fields: Any | None = ...,
102
+ conditions: Any | None = ...,
86
103
  expires_in: int = ...,
87
- region_name: Optional[str] = ...,
104
+ region_name: str | None = ...,
88
105
  ) -> Any: ...
89
106
 
90
107
  def add_generate_presigned_url(class_attributes: Any, **kwargs: Any) -> None: ...
91
108
  def generate_presigned_url(
92
109
  self: Any,
93
110
  ClientMethod: Any,
94
- Params: Optional[Any] = ...,
111
+ Params: Any | None = ...,
95
112
  ExpiresIn: int = ...,
96
- HttpMethod: Optional[Any] = ...,
113
+ HttpMethod: Any | None = ...,
97
114
  ) -> Any: ...
98
115
  def add_generate_presigned_post(class_attributes: Any, **kwargs: Any) -> None: ...
99
116
  def generate_presigned_post(
100
117
  self: Any,
101
118
  Bucket: Any,
102
119
  Key: Any,
103
- Fields: Optional[Any] = ...,
104
- Conditions: Optional[Any] = ...,
120
+ Fields: Any | None = ...,
121
+ Conditions: Any | None = ...,
105
122
  ExpiresIn: int = ...,
106
123
  ) -> Any: ...
botocore-stubs/stub.pyi CHANGED
@@ -1,6 +1,11 @@
1
- import sys
1
+ """
2
+ Type annotations for botocore.stub module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
2
7
  from types import TracebackType
3
- from typing import Any, Mapping, Optional, Type, TypeVar
8
+ from typing import Any, Literal, Mapping, TypeVar
4
9
 
5
10
  from botocore.awsrequest import AWSResponse as AWSResponse
6
11
  from botocore.client import BaseClient
@@ -10,11 +15,6 @@ from botocore.exceptions import StubResponseError as StubResponseError
10
15
  from botocore.exceptions import UnStubbedResponseError as UnStubbedResponseError
11
16
  from botocore.validate import validate_parameters as validate_parameters
12
17
 
13
- if sys.version_info >= (3, 9):
14
- from typing import Literal
15
- else:
16
- from typing_extensions import Literal
17
-
18
18
  class _ANY:
19
19
  def __eq__(self, other: object) -> Literal[True]: ...
20
20
  def __ne__(self, other: object) -> Literal[False]: ...
@@ -30,9 +30,9 @@ class Stubber:
30
30
  def __enter__(self: _R) -> _R: ...
31
31
  def __exit__(
32
32
  self,
33
- exception_type: Optional[Type[BaseException]],
34
- exception_value: Optional[BaseException],
35
- traceback: Optional[TracebackType],
33
+ exception_type: type[BaseException] | None,
34
+ exception_value: BaseException | None,
35
+ traceback: TracebackType | None,
36
36
  ) -> None: ...
37
37
  def activate(self) -> None: ...
38
38
  def deactivate(self) -> None: ...
@@ -40,7 +40,7 @@ class Stubber:
40
40
  self,
41
41
  method: str,
42
42
  service_response: Mapping[str, Any],
43
- expected_params: Optional[Mapping[str, Any]] = ...,
43
+ expected_params: Mapping[str, Any] | None = ...,
44
44
  ) -> None: ...
45
45
  def add_client_error(
46
46
  self,
@@ -48,9 +48,9 @@ class Stubber:
48
48
  service_error_code: str = ...,
49
49
  service_message: str = ...,
50
50
  http_status_code: int = ...,
51
- service_error_meta: Optional[Mapping[str, Any]] = ...,
52
- expected_params: Optional[Mapping[str, Any]] = ...,
53
- response_meta: Optional[Mapping[str, Any]] = ...,
54
- modeled_fields: Optional[Mapping[str, Any]] = ...,
51
+ service_error_meta: Mapping[str, Any] | None = ...,
52
+ expected_params: Mapping[str, Any] | None = ...,
53
+ response_meta: Mapping[str, Any] | None = ...,
54
+ modeled_fields: Mapping[str, Any] | None = ...,
55
55
  ) -> None: ...
56
56
  def assert_no_pending_responses(self) -> None: ...
botocore-stubs/tokens.pyi CHANGED
@@ -1,6 +1,12 @@
1
+ """
2
+ Type annotations for botocore.tokens module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import datetime
2
8
  import logging
3
- from typing import Any, Callable, Iterable, NamedTuple, Optional, Type
9
+ from typing import Any, Callable, Iterable, NamedTuple
4
10
 
5
11
  from botocore.session import Session
6
12
  from botocore.utils import JSONFileCache
@@ -11,7 +17,7 @@ def create_token_resolver(session: Session) -> TokenProviderChain: ...
11
17
 
12
18
  class FrozenAuthToken(NamedTuple):
13
19
  token: str
14
- expiration: Optional[datetime.datetime] = ...
20
+ expiration: datetime.datetime | None = ...
15
21
 
16
22
  class DeferredRefreshableToken:
17
23
  def __init__(
@@ -23,18 +29,18 @@ class DeferredRefreshableToken:
23
29
  def get_frozen_token(self) -> FrozenAuthToken: ...
24
30
 
25
31
  class TokenProviderChain:
26
- def __init__(self, providers: Optional[Iterable[Any]] = ...) -> None: ...
32
+ def __init__(self, providers: Iterable[Any] | None = ...) -> None: ...
27
33
  def load_token(self) -> DeferredRefreshableToken: ...
28
34
 
29
35
  class SSOTokenProvider:
30
36
  METHOD: str = ...
31
- DEFAULT_CACHE_CLS: Type[JSONFileCache] = ...
37
+ DEFAULT_CACHE_CLS: type[JSONFileCache] = ...
32
38
 
33
39
  def __init__(
34
40
  self,
35
41
  session: Session,
36
- cache: Optional[JSONFileCache] = ...,
42
+ cache: JSONFileCache | None = ...,
37
43
  time_fetcher: Callable[[], datetime.datetime] = ...,
38
- profile_name: Optional[str] = ...,
44
+ profile_name: str | None = ...,
39
45
  ) -> None: ...
40
46
  def load_token(self) -> DeferredRefreshableToken: ...
@@ -1,11 +1,18 @@
1
- from typing import Any, Optional
1
+ """
2
+ Type annotations for botocore.translate module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from collections.abc import Mapping
8
+ from typing import Any
2
9
 
3
10
  from botocore.utils import merge_dicts as merge_dicts
4
11
 
5
12
  def build_retry_config(
6
13
  endpoint_prefix: str,
7
- retry_model: Any,
8
- definitions: Any,
9
- client_retry_config: Optional[Any] = ...,
14
+ retry_model: Mapping[str, Any],
15
+ definitions: Mapping[str, Any],
16
+ client_retry_config: Mapping[str, Any] | None = ...,
10
17
  ) -> Any: ...
11
- def resolve_references(config: Any, definitions: Any) -> None: ...
18
+ def resolve_references(config: Mapping[str, Any], definitions: Mapping[str, Any]) -> None: ...
@@ -1,4 +1,10 @@
1
- from typing import Any, List, NamedTuple, Optional, Type, TypeVar
1
+ """
2
+ Type annotations for botocore.useragent module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any, NamedTuple, TypeVar
2
8
 
3
9
  from botocore.config import Config
4
10
 
@@ -9,7 +15,7 @@ def sanitize_user_agent_string_component(raw_str: str, allow_hash: bool) -> str:
9
15
  class UserAgentComponent(NamedTuple):
10
16
  prefix: str
11
17
  name: str
12
- value: Optional[str] = ...
18
+ value: str | None = ...
13
19
 
14
20
  def to_string(self) -> str: ...
15
21
 
@@ -17,7 +23,7 @@ class RawStringUserAgentComponent:
17
23
  def __init__(self, value: str) -> None: ...
18
24
  def to_string(self) -> str: ...
19
25
 
20
- def modify_components(components: List[Any]) -> List[Any]: ...
26
+ def modify_components(components: list[Any]) -> list[Any]: ...
21
27
 
22
28
  class UserAgentString:
23
29
  def __init__(
@@ -28,10 +34,10 @@ class UserAgentString:
28
34
  python_version: str,
29
35
  python_implementation: str,
30
36
  execution_env: str,
31
- crt_version: Optional[str] = ...,
37
+ crt_version: str | None = ...,
32
38
  ) -> None: ...
33
39
  @classmethod
34
- def from_environment(cls: Type[_R]) -> _R: ...
40
+ def from_environment(cls: type[_R]) -> _R: ...
35
41
  def set_session_config(
36
42
  self: _R,
37
43
  session_user_agent_name: str,