botocore-stubs 1.34.66__py3-none-any.whl → 1.35.99__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.99.dist-info}/METADATA +39 -20
  68. botocore_stubs-1.35.99.dist-info/RECORD +73 -0
  69. {botocore_stubs-1.34.66.dist-info → botocore_stubs-1.35.99.dist-info}/WHEEL +2 -1
  70. botocore_stubs-1.35.99.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.99.dist-info}/LICENSE +0 -0
botocore-stubs/config.pyi CHANGED
@@ -1,5 +1,10 @@
1
- import sys
2
- from typing import Dict, Mapping, Optional, Tuple, TypeVar, Union
1
+ """
2
+ Type annotations for botocore.config module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Literal, Mapping, TypedDict, TypeVar
3
8
 
4
9
  from botocore.compat import OrderedDict as OrderedDict
5
10
  from botocore.endpoint import DEFAULT_TIMEOUT as DEFAULT_TIMEOUT
@@ -9,11 +14,6 @@ from botocore.exceptions import InvalidRetryConfigurationError as InvalidRetryCo
9
14
  from botocore.exceptions import InvalidRetryModeError as InvalidRetryModeError
10
15
  from botocore.exceptions import InvalidS3AddressingStyleError as InvalidS3AddressingStyleError
11
16
 
12
- if sys.version_info >= (3, 9):
13
- from typing import Literal, TypedDict
14
- else:
15
- from typing_extensions import Literal, TypedDict
16
-
17
17
  class _RetryDict(TypedDict, total=False):
18
18
  total_max_attempts: int
19
19
  max_attempts: int
@@ -27,34 +27,34 @@ class _S3Dict(TypedDict, total=False):
27
27
 
28
28
  class _ProxiesConfigDict(TypedDict, total=False):
29
29
  proxy_ca_bundle: str
30
- proxy_client_cert: Union[str, Tuple[str, str]]
30
+ proxy_client_cert: str | tuple[str, str]
31
31
  proxy_use_forwarding_for_https: bool
32
32
 
33
- _Config = TypeVar("_Config", bound="Config")
33
+ _Config = TypeVar("_Config", bound=Config)
34
34
 
35
35
  class Config:
36
36
  OPTION_DEFAULTS: OrderedDict[str, None]
37
- NON_LEGACY_OPTION_DEFAULTS: Dict[str, None]
37
+ NON_LEGACY_OPTION_DEFAULTS: dict[str, None]
38
38
  def __init__(
39
39
  self,
40
- region_name: Optional[str] = None,
41
- signature_version: Optional[str] = None,
42
- user_agent: Optional[str] = None,
43
- user_agent_extra: Optional[str] = None,
44
- connect_timeout: Optional[Union[float, int]] = 60,
45
- read_timeout: Optional[Union[float, int]] = 60,
46
- parameter_validation: Optional[bool] = True,
47
- max_pool_connections: Optional[int] = 10,
48
- proxies: Optional[Mapping[str, str]] = None,
49
- proxies_config: Optional[_ProxiesConfigDict] = None,
50
- s3: Optional[_S3Dict] = None,
51
- retries: Optional[_RetryDict] = None,
52
- client_cert: Optional[Union[str, Tuple[str, str]]] = None,
53
- inject_host_prefix: Optional[bool] = True,
54
- endpoint_discovery_enabled: Optional[bool] = None,
55
- use_dualstack_endpoint: Optional[bool] = None,
56
- use_fips_endpoint: Optional[bool] = None,
57
- defaults_mode: Optional[bool] = None,
58
- tcp_keepalive: Optional[bool] = False,
40
+ region_name: str | None = None,
41
+ signature_version: str | None = None,
42
+ user_agent: str | None = None,
43
+ user_agent_extra: str | None = None,
44
+ connect_timeout: float | None = 60,
45
+ read_timeout: float | None = 60,
46
+ parameter_validation: bool | None = True,
47
+ max_pool_connections: int | None = 10,
48
+ proxies: Mapping[str, str] | None = None,
49
+ proxies_config: _ProxiesConfigDict | None = None,
50
+ s3: _S3Dict | None = None,
51
+ retries: _RetryDict | None = None,
52
+ client_cert: str | tuple[str, str] | None = None,
53
+ inject_host_prefix: bool | None = True,
54
+ endpoint_discovery_enabled: bool | None = None,
55
+ use_dualstack_endpoint: bool | None = None,
56
+ use_fips_endpoint: bool | None = None,
57
+ defaults_mode: bool | None = None,
58
+ tcp_keepalive: bool | None = False,
59
59
  ) -> None: ...
60
60
  def merge(self: _Config, other_config: _Config) -> _Config: ...
@@ -1,6 +1,12 @@
1
- from typing import Any, Dict
1
+ """
2
+ Type annotations for botocore.configloader module.
2
3
 
3
- def multi_file_load_config(*filenames: str) -> Dict[str, Any]: ...
4
- def load_config(config_filename: str) -> Dict[str, Any]: ...
5
- def raw_config_parse(config_filename: str, parse_subsections: bool = ...) -> Dict[str, Any]: ...
6
- def build_profile_map(parsed_ini_config: Dict[str, Any]) -> Dict[str, Any]: ...
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from typing import Any
8
+
9
+ def multi_file_load_config(*filenames: str) -> dict[str, Any]: ...
10
+ def load_config(config_filename: str) -> dict[str, Any]: ...
11
+ def raw_config_parse(config_filename: str, parse_subsections: bool = ...) -> dict[str, Any]: ...
12
+ def build_profile_map(parsed_ini_config: dict[str, Any]) -> dict[str, Any]: ...
@@ -1,11 +1,18 @@
1
+ """
2
+ Type annotations for botocore.configprovider module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  from logging import Logger
2
- from typing import Any, Dict, List, Mapping, Optional, Tuple, TypeVar
8
+ from typing import Any, Callable, Mapping, Sequence, TypeVar
3
9
 
10
+ from botocore.session import Session
4
11
  from botocore.utils import IMDSRegionProvider
5
12
 
6
- BOTOCORE_DEFAUT_SESSION_VARIABLES: Dict[str, Tuple[Any, ...]]
7
- DEFAULT_S3_CONFIG_VARS: Dict[str, Tuple[Any, ...]]
8
- DEFAULT_PROXIES_CONFIG_VARS: Dict[str, Tuple[Any, ...]]
13
+ BOTOCORE_DEFAUT_SESSION_VARIABLES: dict[str, tuple[Any, ...]]
14
+ DEFAULT_S3_CONFIG_VARS: dict[str, tuple[Any, ...]]
15
+ DEFAULT_PROXIES_CONFIG_VARS: dict[str, tuple[Any, ...]]
9
16
 
10
17
  logger: Logger = ...
11
18
 
@@ -15,26 +22,26 @@ def create_botocore_default_config_mapping(session: Any) -> Any: ...
15
22
 
16
23
  class DefaultConfigResolver:
17
24
  def __init__(self, default_config_data: Mapping[str, Any]) -> None: ...
18
- def get_default_modes(self) -> List[str]: ...
25
+ def get_default_modes(self) -> list[str]: ...
19
26
  def get_default_config_values(self, mode: str) -> Any: ...
20
27
 
21
28
  class ConfigChainFactory:
22
- def __init__(self, session: Any, environ: Optional[Any] = ...) -> None: ...
29
+ def __init__(self, session: Any, environ: Any | None = ...) -> None: ...
23
30
  def create_config_chain(
24
31
  self,
25
- instance_name: Optional[Any] = ...,
26
- env_var_names: Optional[Any] = ...,
27
- config_property_names: Optional[Any] = ...,
28
- default: Optional[Any] = ...,
29
- conversion_func: Optional[Any] = ...,
30
- ) -> Any: ...
32
+ instance_name: str | None = ...,
33
+ env_var_names: str | list[str] | None = ...,
34
+ config_property_names: str | Sequence[str] | None = ...,
35
+ default: Any | None = ...,
36
+ conversion_func: Callable[..., Any] | None = ...,
37
+ ) -> ChainProvider: ...
31
38
 
32
39
  class ConfigValueStore:
33
- def __init__(self, mapping: Optional[Any] = ...) -> None: ...
34
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
40
+ def __init__(self, mapping: Mapping[str, Any] | None = ...) -> None: ...
41
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
35
42
  def __copy__(self: _R) -> _R: ...
36
43
  def get_config_variable(self, logical_name: str) -> Any: ...
37
- def get_config_provider(self, logical_name: str) -> "BaseProvider": ...
44
+ def get_config_provider(self, logical_name: str) -> BaseProvider: ...
38
45
  def set_config_variable(self, logical_name: str, value: Any) -> None: ...
39
46
  def clear_config_variable(self, logical_name: str) -> None: ...
40
47
  def set_config_provider(self, logical_name: str, provider: Any) -> None: ...
@@ -51,42 +58,47 @@ class SmartDefaultsConfigStoreFactory:
51
58
  def resolve_auto_mode(self, region_name: str) -> str: ...
52
59
 
53
60
  class BaseProvider:
54
- def provide(self) -> None: ...
61
+ def provide(self) -> Any: ...
55
62
 
56
63
  class ChainProvider(BaseProvider):
57
64
  def __init__(
58
- self, providers: Optional[Any] = ..., conversion_func: Optional[Any] = ...
65
+ self,
66
+ providers: Sequence[BaseProvider] | None = ...,
67
+ conversion_func: Callable[..., Any] | None = ...,
59
68
  ) -> None: ...
60
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
69
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
61
70
  def provide(self) -> Any: ...
62
71
  def set_default_provider(self, default_provider: BaseProvider) -> None: ...
63
72
 
64
73
  class InstanceVarProvider(BaseProvider):
65
- def __init__(self, instance_var: Any, session: Any) -> None: ...
66
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
74
+ def __init__(self, instance_var: str, session: Session) -> None: ...
75
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
67
76
  def provide(self) -> Any: ...
68
77
 
69
78
  class ScopedConfigProvider(BaseProvider):
70
- def __init__(self, config_var_name: Any, session: Any) -> None: ...
71
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
79
+ def __init__(self, config_var_name: str, session: Session) -> None: ...
80
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
72
81
  def provide(self) -> Any: ...
73
82
 
74
83
  class EnvironmentProvider(BaseProvider):
75
- def __init__(self, name: Any, env: Any) -> None: ...
76
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
84
+ def __init__(self, name: str, env: Mapping[str, str]) -> None: ...
85
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
77
86
  def provide(self) -> Any: ...
78
87
 
79
88
  class SectionConfigProvider(BaseProvider):
80
89
  def __init__(
81
- self, section_name: Any, session: Any, override_providers: Optional[Any] = ...
90
+ self,
91
+ section_name: str,
92
+ session: Session,
93
+ override_providers: dict[str, BaseProvider] | None = ...,
82
94
  ) -> None: ...
83
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
95
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
84
96
  def provide(self) -> Any: ...
85
97
  def set_default_provider(self, key: str, default_provider: BaseProvider) -> None: ...
86
98
 
87
99
  class ConstantProvider(BaseProvider):
88
100
  def __init__(self, value: Any) -> None: ...
89
- def __deepcopy__(self: _R, memo: Dict[str, Any]) -> _R: ...
101
+ def __deepcopy__(self: _R, memo: dict[str, Any]) -> _R: ...
90
102
  def provide(self) -> Any: ...
91
103
 
92
104
  class ConfiguredEndpointProvider(BaseProvider):
@@ -95,6 +107,6 @@ class ConfiguredEndpointProvider(BaseProvider):
95
107
  full_config: Mapping[str, Any],
96
108
  scoped_config: Mapping[str, Any],
97
109
  client_name: str,
98
- environ: Optional[Mapping[str, str]] = ...,
110
+ environ: Mapping[str, str] | None = ...,
99
111
  ) -> None: ...
100
112
  def provide(self) -> Any: ...
@@ -1,6 +1,12 @@
1
+ """
2
+ Type annotations for botocore.credentials module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
1
7
  import datetime
2
8
  from logging import Logger
3
- from typing import Any, Callable, Dict, List, Mapping, NamedTuple, Optional, Type, TypeVar
9
+ from typing import Any, Callable, Mapping, NamedTuple, TypeVar
4
10
 
5
11
  from botocore.client import BaseClient
6
12
  from botocore.compat import compat_shell_split as compat_shell_split
@@ -34,21 +40,21 @@ class ReadOnlyCredentials(NamedTuple):
34
40
 
35
41
  def create_credential_resolver(
36
42
  session: Session,
37
- cache: Optional[Dict[str, Any]] = ...,
38
- region_name: Optional[str] = ...,
43
+ cache: dict[str, Any] | None = ...,
44
+ region_name: str | None = ...,
39
45
  ) -> CredentialResolver: ...
40
46
 
41
47
  class ProfileProviderBuilder:
42
48
  def __init__(
43
49
  self,
44
50
  session: Session,
45
- cache: Optional[Dict[str, Any]] = ...,
46
- region_name: Optional[str] = ...,
47
- sso_token_cache: Optional[Dict[str, Any]] = ...,
51
+ cache: dict[str, Any] | None = ...,
52
+ region_name: str | None = ...,
53
+ sso_token_cache: dict[str, Any] | None = ...,
48
54
  ) -> None: ...
49
55
  def providers(
50
56
  self, profile_name: str, disable_env_vars: bool = ...
51
- ) -> List[CredentialProvider]: ...
57
+ ) -> list[CredentialProvider]: ...
52
58
 
53
59
  def get_credentials(session: Session) -> Any: ...
54
60
  def create_assume_role_refresher(client: BaseClient, params: Any) -> Any: ...
@@ -59,12 +65,12 @@ class Credentials:
59
65
  self,
60
66
  access_key: str,
61
67
  secret_key: str,
62
- token: Optional[str] = ...,
63
- method: Optional[str] = ...,
68
+ token: str | None = ...,
69
+ method: str | None = ...,
64
70
  ) -> None:
65
71
  self.access_key: str = ...
66
72
  self.secret_key: str = ...
67
- self.token: Optional[str] = ...
73
+ self.token: str | None = ...
68
74
  self.method: str = ...
69
75
 
70
76
  def get_frozen_credentials(self) -> ReadOnlyCredentials: ...
@@ -79,18 +85,18 @@ class RefreshableCredentials(Credentials):
79
85
  expiry_time: datetime.datetime,
80
86
  refresh_using: Callable[[], Any],
81
87
  method: str,
82
- time_fetcher: Optional[Callable[[], datetime.datetime]] = ...,
83
- advisory_timeout: Optional[int] = ...,
84
- mandatory_timeout: Optional[int] = ...,
88
+ time_fetcher: Callable[[], datetime.datetime] | None = ...,
89
+ advisory_timeout: int | None = ...,
90
+ mandatory_timeout: int | None = ...,
85
91
  ) -> None: ...
86
92
  @classmethod
87
93
  def create_from_metadata(
88
- cls: Type[_R],
89
- metadata: Dict[str, Any],
94
+ cls: type[_R],
95
+ metadata: dict[str, Any],
90
96
  refresh_using: Callable[[], Any],
91
97
  method: Any,
92
- advisory_timeout: Optional[int] = ...,
93
- mandatory_timeout: Optional[int] = ...,
98
+ advisory_timeout: int | None = ...,
99
+ mandatory_timeout: int | None = ...,
94
100
  ) -> _R: ...
95
101
  @property # type: ignore [override]
96
102
  def access_key(self) -> str: ... # type: ignore [override]
@@ -104,7 +110,7 @@ class RefreshableCredentials(Credentials):
104
110
  def token(self) -> str: ... # type: ignore [override]
105
111
  @token.setter
106
112
  def token(self, value: str) -> None: ...
107
- def refresh_needed(self, refresh_in: Optional[int] = ...) -> bool: ...
113
+ def refresh_needed(self, refresh_in: int | None = ...) -> bool: ...
108
114
  def get_frozen_credentials(self) -> ReadOnlyCredentials: ...
109
115
 
110
116
  class DeferredRefreshableCredentials(RefreshableCredentials):
@@ -112,27 +118,27 @@ class DeferredRefreshableCredentials(RefreshableCredentials):
112
118
  self,
113
119
  refresh_using: Callable[[], Any],
114
120
  method: Any,
115
- time_fetcher: Optional[Callable[[], datetime.datetime]] = ...,
121
+ time_fetcher: Callable[[], datetime.datetime] | None = ...,
116
122
  ) -> None:
117
123
  self.method: Any = ...
118
124
 
119
- def refresh_needed(self, refresh_in: Optional[int] = ...) -> bool: ...
125
+ def refresh_needed(self, refresh_in: int | None = ...) -> bool: ...
120
126
 
121
127
  class CachedCredentialFetcher:
122
128
  DEFAULT_EXPIRY_WINDOW_SECONDS: int = ...
123
129
  def __init__(
124
- self, cache: Optional[Any] = ..., expiry_window_seconds: Optional[int] = ...
130
+ self, cache: Any | None = ..., expiry_window_seconds: int | None = ...
125
131
  ) -> None: ...
126
- def fetch_credentials(self) -> Dict[str, Any]: ...
132
+ def fetch_credentials(self) -> dict[str, Any]: ...
127
133
 
128
134
  class BaseAssumeRoleCredentialFetcher(CachedCredentialFetcher):
129
135
  def __init__(
130
136
  self,
131
137
  client_creator: Callable[[], BaseClient],
132
138
  role_arn: str,
133
- extra_args: Optional[Any] = ...,
134
- cache: Optional[Any] = ...,
135
- expiry_window_seconds: Optional[Any] = ...,
139
+ extra_args: Any | None = ...,
140
+ cache: Any | None = ...,
141
+ expiry_window_seconds: Any | None = ...,
136
142
  ) -> None: ...
137
143
 
138
144
  class AssumeRoleCredentialFetcher(BaseAssumeRoleCredentialFetcher):
@@ -141,55 +147,57 @@ class AssumeRoleCredentialFetcher(BaseAssumeRoleCredentialFetcher):
141
147
  client_creator: Callable[[], BaseClient],
142
148
  source_credentials: Any,
143
149
  role_arn: str,
144
- extra_args: Optional[Dict[str, Any]] = ...,
145
- mfa_prompter: Optional[Callable[..., Any]] = ...,
146
- cache: Optional[Dict[str, Any]] = ...,
147
- expiry_window_seconds: Optional[int] = ...,
150
+ extra_args: dict[str, Any] | None = ...,
151
+ mfa_prompter: Callable[..., Any] | None = ...,
152
+ cache: dict[str, Any] | None = ...,
153
+ expiry_window_seconds: int | None = ...,
148
154
  ) -> None: ...
149
155
 
150
156
  class AssumeRoleWithWebIdentityCredentialFetcher(BaseAssumeRoleCredentialFetcher):
151
157
  def __init__(
152
158
  self,
153
159
  client_creator: Callable[[], BaseClient],
154
- web_identity_token_loader: Any,
160
+ web_identity_token_loader: Callable[[], str],
155
161
  role_arn: str,
156
- extra_args: Optional[Any] = ...,
157
- cache: Optional[Dict[str, Any]] = ...,
158
- expiry_window_seconds: Optional[int] = ...,
162
+ extra_args: Any | None = ...,
163
+ cache: dict[str, Any] | None = ...,
164
+ expiry_window_seconds: int | None = ...,
159
165
  ) -> None: ...
160
166
 
161
167
  class CredentialProvider:
162
- METHOD: Optional[str] = ...
163
- CANONICAL_NAME: Optional[str] = ...
164
- def __init__(self, session: Optional[Session] = ...) -> None:
168
+ METHOD: str | None = ...
169
+ CANONICAL_NAME: str | None = ...
170
+ def __init__(self, session: Session | None = ...) -> None:
165
171
  self.session: Session = ...
166
172
 
167
173
  def load(self) -> Any: ...
168
174
 
169
175
  class ProcessProvider(CredentialProvider):
170
176
  METHOD: str = ...
171
- def __init__(self, profile_name: str, load_config: Any, popen: Any = ...) -> None: ...
172
- def load(self) -> Optional[Credentials]: ...
177
+ def __init__(
178
+ self, profile_name: str, load_config: Callable[..., Any], popen: Callable[..., Any] = ...
179
+ ) -> None: ...
180
+ def load(self) -> Credentials | None: ...
173
181
 
174
182
  class InstanceMetadataProvider(CredentialProvider):
175
183
  METHOD: str = ...
176
184
  CANONICAL_NAME: str = ...
177
- def __init__(self, iam_role_fetcher: Any) -> None: ...
178
- def load(self) -> Optional[Credentials]: ...
185
+ def __init__(self, iam_role_fetcher: InstanceMetadataFetcher) -> None: ...
186
+ def load(self) -> Credentials | None: ...
179
187
 
180
188
  class EnvProvider(CredentialProvider):
181
189
  METHOD: str = ...
182
190
  CANONICAL_NAME: str = ...
183
191
  ACCESS_KEY: str = ...
184
192
  SECRET_KEY: str = ...
185
- TOKENS: Any = ...
193
+ TOKENS: list[str] = ...
186
194
  EXPIRY_TIME: str = ...
187
195
  def __init__(
188
- self, environ: Optional[Mapping[str, Any]] = ..., mapping: Optional[Mapping[str, Any]] = ...
196
+ self, environ: Mapping[str, Any] | None = ..., mapping: Mapping[str, Any] | None = ...
189
197
  ) -> None:
190
198
  self.environ: Mapping[str, Any] = ...
191
199
 
192
- def load(self) -> Optional[Credentials]: ...
200
+ def load(self) -> Credentials | None: ...
193
201
 
194
202
  class OriginalEC2Provider(CredentialProvider):
195
203
  METHOD: str = ...
@@ -197,83 +205,85 @@ class OriginalEC2Provider(CredentialProvider):
197
205
  CRED_FILE_ENV: str = ...
198
206
  ACCESS_KEY: str = ...
199
207
  SECRET_KEY: str = ...
200
- def __init__(self, environ: Optional[Any] = ..., parser: Optional[Any] = ...) -> None: ...
201
- def load(self) -> Optional[Credentials]: ...
208
+ def __init__(
209
+ self, environ: Mapping[str, str] | None = ..., parser: Callable[..., Any] | None = ...
210
+ ) -> None: ...
211
+ def load(self) -> Credentials | None: ...
202
212
 
203
213
  class SharedCredentialProvider(CredentialProvider):
204
214
  METHOD: str = ...
205
215
  CANONICAL_NAME: str = ...
206
216
  ACCESS_KEY: str = ...
207
217
  SECRET_KEY: str = ...
208
- TOKENS: Any = ...
218
+ TOKENS: list[str] = ...
209
219
  def __init__(
210
220
  self,
211
221
  creds_filename: str,
212
- profile_name: Optional[str] = ...,
213
- ini_parser: Optional[Any] = ...,
222
+ profile_name: str | None = ...,
223
+ ini_parser: Any | None = ...,
214
224
  ) -> None: ...
215
- def load(self) -> Optional[Credentials]: ...
225
+ def load(self) -> Credentials | None: ...
216
226
 
217
227
  class ConfigProvider(CredentialProvider):
218
228
  METHOD: str = ...
219
229
  CANONICAL_NAME: str = ...
220
230
  ACCESS_KEY: str = ...
221
231
  SECRET_KEY: str = ...
222
- TOKENS: List[str] = ...
232
+ TOKENS: list[str] = ...
223
233
  def __init__(
224
234
  self,
225
235
  config_filename: str,
226
236
  profile_name: str,
227
- config_parser: Optional[Any] = ...,
237
+ config_parser: Any | None = ...,
228
238
  ) -> None: ...
229
- def load(self) -> Optional[Credentials]: ...
239
+ def load(self) -> Credentials | None: ...
230
240
 
231
241
  class BotoProvider(CredentialProvider):
232
242
  METHOD: str = ...
233
243
  CANONICAL_NAME: str = ...
234
244
  BOTO_CONFIG_ENV: str = ...
235
- DEFAULT_CONFIG_FILENAMES: Any = ...
245
+ DEFAULT_CONFIG_FILENAMES: list[str] = ...
236
246
  ACCESS_KEY: str = ...
237
247
  SECRET_KEY: str = ...
238
- def __init__(self, environ: Optional[Any] = ..., ini_parser: Optional[Any] = ...) -> None: ...
239
- def load(self) -> Optional[Credentials]: ...
248
+ def __init__(self, environ: Any | None = ..., ini_parser: Any | None = ...) -> None: ...
249
+ def load(self) -> Credentials | None: ...
240
250
 
241
251
  class AssumeRoleProvider(CredentialProvider):
242
252
  METHOD: str = ...
243
- CANONICAL_NAME: Any = ...
253
+ CANONICAL_NAME: None = ...
244
254
  ROLE_CONFIG_VAR: str = ...
245
255
  WEB_IDENTITY_TOKE_FILE_VAR: str = ...
246
- EXPIRY_WINDOW_SECONDS: Any = ...
247
- cache: Any = ...
256
+ EXPIRY_WINDOW_SECONDS: int = ...
248
257
  def __init__(
249
258
  self,
250
259
  load_config: Callable[[], Mapping[str, Any]],
251
260
  client_creator: Callable[..., Any],
252
- cache: Dict[str, Any],
261
+ cache: dict[str, Any],
253
262
  profile_name: str,
254
263
  prompter: Callable[..., Any] = ...,
255
- credential_sourcer: Optional[CanonicalNameCredentialSourcer] = ...,
256
- profile_provider_builder: Optional[Any] = ...,
257
- ) -> None: ...
258
- def load(self) -> Optional[DeferredRefreshableCredentials]: ...
264
+ credential_sourcer: CanonicalNameCredentialSourcer | None = ...,
265
+ profile_provider_builder: Any | None = ...,
266
+ ) -> None:
267
+ self.cache: dict[str, Any] = ...
268
+ def load(self) -> DeferredRefreshableCredentials | None: ...
259
269
 
260
270
  class AssumeRoleWithWebIdentityProvider(CredentialProvider):
261
271
  METHOD: str = ...
262
- CANONICAL_NAME: Any = ...
263
- cache: Any = ...
272
+ CANONICAL_NAME: None = ...
264
273
  def __init__(
265
274
  self,
266
- load_config: Any,
267
- client_creator: Any,
275
+ load_config: Callable[[], Mapping[str, Any]],
276
+ client_creator: Callable[..., Any],
268
277
  profile_name: str,
269
- cache: Optional[Any] = ...,
278
+ cache: dict[str, Any] | None = ...,
270
279
  disable_env_vars: bool = ...,
271
- token_loader_cls: Optional[Any] = ...,
272
- ) -> None: ...
273
- def load(self) -> Optional[DeferredRefreshableCredentials]: ...
280
+ token_loader_cls: type[FileWebIdentityTokenLoader] | None = ...,
281
+ ) -> None:
282
+ self.cache: dict[str, Any] = ...
283
+ def load(self) -> DeferredRefreshableCredentials | None: ...
274
284
 
275
285
  class CanonicalNameCredentialSourcer:
276
- def __init__(self, providers: List[CredentialProvider]) -> None: ...
286
+ def __init__(self, providers: list[CredentialProvider]) -> None: ...
277
287
  def is_supported(self, source_name: str) -> bool: ...
278
288
  def source_credentials(self, source_name: str) -> Credentials: ...
279
289
 
@@ -285,44 +295,46 @@ class ContainerProvider(CredentialProvider):
285
295
  ENV_VAR_AUTH_TOKEN: str = ...
286
296
  ENV_VAR_AUTH_TOKEN_FILE: str = ...
287
297
  def __init__(
288
- self, environ: Optional[Mapping[str, str]] = ..., fetcher: Optional[Any] = ...
298
+ self,
299
+ environ: Mapping[str, str] | None = ...,
300
+ fetcher: AssumeRoleCredentialFetcher | None = ...,
289
301
  ) -> None: ...
290
302
  def load(self) -> RefreshableCredentials: ...
291
303
 
292
304
  class CredentialResolver:
293
- providers: List[CredentialProvider]
294
- def __init__(self, providers: List[CredentialProvider]) -> None: ...
305
+ providers: list[CredentialProvider]
306
+ def __init__(self, providers: list[CredentialProvider]) -> None: ...
295
307
  def insert_before(self, name: str, credential_provider: CredentialProvider) -> None: ...
296
308
  def insert_after(self, name: str, credential_provider: CredentialProvider) -> None: ...
297
309
  def remove(self, name: str) -> None: ...
298
310
  def get_provider(self, name: str) -> CredentialProvider: ...
299
- def load_credentials(self) -> Optional[Credentials]: ...
311
+ def load_credentials(self) -> Credentials | None: ...
300
312
 
301
313
  class SSOCredentialFetcher(CachedCredentialFetcher):
302
314
  def __init__(
303
315
  self,
304
- start_url: Any,
305
- sso_region: Any,
306
- role_name: Any,
307
- account_id: Any,
308
- client_creator: Any,
309
- token_loader: Optional[Any] = ...,
310
- cache: Optional[Any] = ...,
311
- expiry_window_seconds: Optional[Any] = ...,
312
- token_provider: Optional[SSOTokenProvider] = ...,
313
- sso_session_name: Optional[str] = ...,
316
+ start_url: str,
317
+ sso_region: str,
318
+ role_name: str,
319
+ account_id: str,
320
+ client_creator: Callable[..., Any],
321
+ token_loader: Callable[[], str] | None = ...,
322
+ cache: dict[str, Any] | None = ...,
323
+ expiry_window_seconds: float | None = ...,
324
+ token_provider: SSOTokenProvider | None = ...,
325
+ sso_session_name: str | None = ...,
314
326
  ) -> None: ...
315
327
 
316
328
  class SSOProvider(CredentialProvider):
317
329
  METHOD: str = ...
318
- cache: Any = ...
319
330
  def __init__(
320
331
  self,
321
- load_config: Any,
322
- client_creator: Any,
332
+ load_config: Callable[[], Any],
333
+ client_creator: Callable[..., Any],
323
334
  profile_name: str,
324
- cache: Optional[Any] = ...,
325
- token_cache: Optional[Any] = ...,
326
- token_provider: Optional[SSOTokenProvider] = ...,
327
- ) -> None: ...
335
+ cache: dict[str, Any] | None = ...,
336
+ token_cache: dict[str, Any] | None = ...,
337
+ token_provider: SSOTokenProvider | None = ...,
338
+ ) -> None:
339
+ self.cache: dict[str, Any] = ...
328
340
  def load(self) -> DeferredRefreshableCredentials: ...
@@ -1,3 +1,7 @@
1
- from typing import Tuple
1
+ """
2
+ Type annotations for botocore.crt module.
2
3
 
3
- CRT_SUPPORTED_AUTH_TYPES: Tuple[str, ...] = ...
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ CRT_SUPPORTED_AUTH_TYPES: tuple[str, ...] = ...
@@ -1,4 +1,8 @@
1
- from typing import Dict, Type
1
+ """
2
+ Type annotations for botocore.crt.auth module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
2
6
 
3
7
  from awscrt.auth import AwsCredentials
4
8
  from botocore.auth import SIGNED_HEADERS_BLACKLIST as SIGNED_HEADERS_BLACKLIST
@@ -68,4 +72,4 @@ class CrtSigV4QueryAuth(CrtSigV4Auth):
68
72
 
69
73
  class CrtS3SigV4QueryAuth(CrtSigV4QueryAuth): ...
70
74
 
71
- CRT_AUTH_TYPE_MAPS: Dict[str, Type[BaseSigner]] = ...
75
+ CRT_AUTH_TYPE_MAPS: dict[str, type[BaseSigner]] = ...