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