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,10 +1,14 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Optional, Tuple
6
+ from typing import Any
3
7
 
4
8
  from botocore.docs.bcdoc.restdoc import ReSTDocument
5
9
 
6
10
  logger: Logger = ...
7
- PUNCTUATION_CHARACTERS: Tuple[str, ...] = ...
11
+ PUNCTUATION_CHARACTERS: tuple[str, ...] = ...
8
12
 
9
13
  class BaseStyle:
10
14
  def __init__(self, doc: ReSTDocument, indent_width: int = ...) -> None: ...
@@ -17,7 +21,7 @@ class BaseStyle:
17
21
  def dedent(self) -> None: ...
18
22
  def spaces(self) -> str: ...
19
23
  def bold(self, s: str) -> str: ...
20
- def ref(self, link: Optional[str], title: Optional[str] = ...) -> str: ...
24
+ def ref(self, link: str | None, title: str | None = ...) -> str: ...
21
25
  def h2(self, s: str) -> str: ...
22
26
  def h3(self, s: str) -> str: ...
23
27
  def underline(self, s: str) -> str: ...
@@ -33,7 +37,7 @@ class ReSTStyle(BaseStyle):
33
37
  def start_b(self, attrs: Any = ...) -> None: ...
34
38
  def end_b(self) -> None: ...
35
39
  def bold(self, s: str) -> None: ... # type: ignore[override]
36
- def ref(self, title: str, link: Optional[str] = ...) -> None: ... # type: ignore[override]
40
+ def ref(self, title: str, link: str | None = ...) -> None: ... # type: ignore[override]
37
41
  def h1(self, s: str) -> None: ...
38
42
  def h2(self, s: str) -> None: ... # type: ignore[override]
39
43
  def h3(self, s: str) -> None: ... # type: ignore[override]
@@ -53,7 +57,7 @@ class ReSTStyle(BaseStyle):
53
57
  def end_danger(self) -> None: ...
54
58
  def start_a(self, attrs: Any = ...) -> None: ...
55
59
  def link_target_definition(self, refname: str, link: str) -> None: ...
56
- def sphinx_reference_label(self, label: str, text: Optional[str] = ...) -> None: ...
60
+ def sphinx_reference_label(self, label: str, text: str | None = ...) -> None: ...
57
61
  def end_a(self, next_child: Any = ...) -> None: ...
58
62
  def start_i(self, attrs: Any = ...) -> None: ...
59
63
  def end_i(self) -> None: ...
@@ -72,10 +76,10 @@ class ReSTStyle(BaseStyle):
72
76
  def end_codeblock(self) -> None: ...
73
77
  def codeblock(self, code: str) -> None: ...
74
78
  def toctree(self) -> None: ...
75
- def tocitem(self, item: str, file_name: Optional[str] = ...) -> None: ...
79
+ def tocitem(self, item: str, file_name: str | None = ...) -> None: ...
76
80
  def hidden_toctree(self) -> None: ...
77
81
  def hidden_tocitem(self, item: str) -> None: ...
78
- def table_of_contents(self, title: Optional[str] = ..., depth: Optional[int] = ...) -> None: ...
82
+ def table_of_contents(self, title: str | None = ..., depth: int | None = ...) -> None: ...
79
83
  def start_sphinx_py_class(self, class_name: str) -> None: ...
80
84
  def end_sphinx_py_class(self) -> None: ...
81
85
  def start_sphinx_py_method(self, method_name: str, parameters: Any = ...) -> None: ...
@@ -1,16 +1,20 @@
1
- from typing import Any, Callable, Dict, List, Optional, Tuple
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any, Callable
2
6
 
3
7
  from botocore.client import BaseClient
4
8
  from botocore.docs.bcdoc.restdoc import DocumentStructure
5
9
  from botocore.docs.utils import DocumentedShape
6
10
 
7
11
  class ClientDocumenter:
8
- _CLIENT_METHODS_FILTERS: List[Callable[..., bool]] = ...
12
+ _CLIENT_METHODS_FILTERS: list[Callable[..., bool]] = ...
9
13
  def __init__(
10
14
  self,
11
15
  client: BaseClient,
12
16
  root_docs_path: str,
13
- shared_examples: Optional[Dict[str, Any]] = ...,
17
+ shared_examples: dict[str, Any] | None = ...,
14
18
  ) -> None: ...
15
19
  def document_client(self, section: DocumentStructure) -> None: ...
16
20
 
@@ -22,6 +26,6 @@ class ClientExceptionsDocumenter:
22
26
 
23
27
  class ClientContextParamsDocumenter:
24
28
  _CONFIG_GUIDE_LINK: str = ...
25
- OMITTED_CONTEXT_PARAMS: Dict[str, Tuple[str, ...]] = ...
29
+ OMITTED_CONTEXT_PARAMS: dict[str, tuple[str, ...]] = ...
26
30
  def __init__(self, service_name: str, context_params: Any) -> None: ...
27
31
  def document_context_params(self, section: DocumentStructure) -> None: ...
@@ -1,11 +1,13 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any
2
6
 
3
7
  class LazyLoadedDocstring(str):
4
8
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
5
9
  def __new__(cls, *args: Any, **kwargs: Any) -> Any: ...
6
10
  def expandtabs(self, tabsize: Any = ...) -> str: ...
7
- def __str__(self) -> str: ...
8
- def __repr__(self) -> str: ...
9
11
 
10
12
  class ClientMethodDocstring(LazyLoadedDocstring): ...
11
13
  class WaiterDocstring(LazyLoadedDocstring): ...
@@ -1,4 +1,8 @@
1
- from typing import Any, List, Optional
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any
2
6
 
3
7
  from botocore.docs.shape import ShapeDocumenter
4
8
  from botocore.model import Shape
@@ -8,9 +12,9 @@ class BaseExampleDocumenter(ShapeDocumenter):
8
12
  self,
9
13
  section: Any,
10
14
  shape: Shape,
11
- prefix: Optional[str] = ...,
12
- include: Optional[List[str]] = ...,
13
- exclude: Optional[List[str]] = ...,
15
+ prefix: str | None = ...,
16
+ include: list[str] | None = ...,
17
+ exclude: list[str] | None = ...,
14
18
  ) -> None: ...
15
19
  def document_recursive_shape(self, section: Any, shape: Shape, **kwargs: Any) -> None: ...
16
20
  def document_shape_default(
@@ -18,8 +22,8 @@ class BaseExampleDocumenter(ShapeDocumenter):
18
22
  section: Any,
19
23
  shape: Shape,
20
24
  history: Any,
21
- include: Optional[List[str]] = ...,
22
- exclude: Optional[List[str]] = ...,
25
+ include: list[str] | None = ...,
26
+ exclude: list[str] | None = ...,
23
27
  **kwargs: Any,
24
28
  ) -> None: ...
25
29
  def document_shape_type_string(
@@ -27,8 +31,8 @@ class BaseExampleDocumenter(ShapeDocumenter):
27
31
  section: Any,
28
32
  shape: Shape,
29
33
  history: Any,
30
- include: Optional[List[str]] = ...,
31
- exclude: Optional[List[str]] = ...,
34
+ include: list[str] | None = ...,
35
+ exclude: list[str] | None = ...,
32
36
  **kwargs: Any,
33
37
  ) -> None: ...
34
38
  def document_shape_type_list(
@@ -36,8 +40,8 @@ class BaseExampleDocumenter(ShapeDocumenter):
36
40
  section: Any,
37
41
  shape: Shape,
38
42
  history: Any,
39
- include: Optional[List[str]] = ...,
40
- exclude: Optional[List[str]] = ...,
43
+ include: list[str] | None = ...,
44
+ exclude: list[str] | None = ...,
41
45
  **kwargs: Any,
42
46
  ) -> None: ...
43
47
  def document_shape_type_structure(
@@ -45,8 +49,8 @@ class BaseExampleDocumenter(ShapeDocumenter):
45
49
  section: Any,
46
50
  shape: Shape,
47
51
  history: Any,
48
- include: Optional[List[str]] = ...,
49
- exclude: Optional[List[str]] = ...,
52
+ include: list[str] | None = ...,
53
+ exclude: list[str] | None = ...,
50
54
  **kwargs: Any,
51
55
  ) -> None: ...
52
56
  def document_shape_type_map(
@@ -54,8 +58,8 @@ class BaseExampleDocumenter(ShapeDocumenter):
54
58
  section: Any,
55
59
  shape: Shape,
56
60
  history: Any,
57
- include: Optional[List[str]] = ...,
58
- exclude: Optional[List[str]] = ...,
61
+ include: list[str] | None = ...,
62
+ exclude: list[str] | None = ...,
59
63
  **kwargs: Any,
60
64
  ) -> None: ...
61
65
 
@@ -76,7 +80,7 @@ class RequestExampleDocumenter(BaseExampleDocumenter):
76
80
  section: Any,
77
81
  shape: Shape,
78
82
  history: Any,
79
- include: Optional[List[str]] = ...,
80
- exclude: Optional[List[str]] = ...,
83
+ include: list[str] | None = ...,
84
+ exclude: list[str] | None = ...,
81
85
  **kwargs: Any,
82
86
  ) -> None: ...
@@ -1,24 +1,28 @@
1
- from typing import Any, Dict, Optional, Sequence
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any, Sequence
2
6
 
3
7
  from botocore.hooks import BaseEventHooks
4
8
  from botocore.model import OperationModel
5
9
 
6
10
  AWS_DOC_BASE: str = ...
7
11
 
8
- def get_instance_public_methods(instance: Any) -> Dict[str, Any]: ...
12
+ def get_instance_public_methods(instance: Any) -> dict[str, Any]: ...
9
13
  def document_model_driven_signature(
10
14
  section: Any,
11
15
  name: str,
12
16
  operation_model: OperationModel,
13
- include: Optional[Sequence[str]] = ...,
14
- exclude: Optional[Sequence[str]] = ...,
17
+ include: Sequence[str] | None = ...,
18
+ exclude: Sequence[str] | None = ...,
15
19
  ) -> None: ...
16
20
  def document_custom_signature(
17
21
  section: Any,
18
22
  name: str,
19
23
  method: Any,
20
- include: Optional[Sequence[str]] = ...,
21
- exclude: Optional[Sequence[str]] = ...,
24
+ include: Sequence[str] | None = ...,
25
+ exclude: Sequence[str] | None = ...,
22
26
  ) -> None: ...
23
27
  def document_custom_method(section: Any, method_name: str, method: Any) -> None: ...
24
28
  def document_model_driven_method(
@@ -26,12 +30,12 @@ def document_model_driven_method(
26
30
  method_name: str,
27
31
  operation_model: OperationModel,
28
32
  event_emitter: BaseEventHooks,
29
- method_description: Optional[str] = ...,
30
- example_prefix: Optional[str] = ...,
31
- include_input: Optional[Dict[str, Any]] = ...,
32
- include_output: Optional[Dict[str, Any]] = ...,
33
- exclude_input: Optional[Sequence[str]] = ...,
34
- exclude_output: Optional[Sequence[str]] = ...,
33
+ method_description: str | None = ...,
34
+ example_prefix: str | None = ...,
35
+ include_input: dict[str, Any] | None = ...,
36
+ include_output: dict[str, Any] | None = ...,
37
+ exclude_input: Sequence[str] | None = ...,
38
+ exclude_output: Sequence[str] | None = ...,
35
39
  document_output: bool = ...,
36
40
  include_signature: bool = ...,
37
41
  ) -> None: ...
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any
2
6
 
3
7
  from botocore.client import BaseClient
@@ -1,4 +1,8 @@
1
- from typing import Any, Optional, Sequence
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any, Sequence
2
6
 
3
7
  from botocore.docs.shape import ShapeDocumenter
4
8
  from botocore.model import Shape
@@ -8,8 +12,8 @@ class BaseParamsDocumenter(ShapeDocumenter):
8
12
  self,
9
13
  section: Any,
10
14
  shape: Shape,
11
- include: Optional[Sequence[str]] = ...,
12
- exclude: Optional[Sequence[str]] = ...,
15
+ include: Sequence[str] | None = ...,
16
+ exclude: Sequence[str] | None = ...,
13
17
  ) -> None: ...
14
18
  def document_recursive_shape(self, section: Any, shape: Shape, **kwargs: Any) -> None: ...
15
19
  def document_shape_default(
@@ -17,8 +21,8 @@ class BaseParamsDocumenter(ShapeDocumenter):
17
21
  section: Any,
18
22
  shape: Shape,
19
23
  history: Any,
20
- include: Optional[Sequence[str]] = ...,
21
- exclude: Optional[Sequence[str]] = ...,
24
+ include: Sequence[str] | None = ...,
25
+ exclude: Sequence[str] | None = ...,
22
26
  **kwargs: Any,
23
27
  ) -> None: ...
24
28
  def document_shape_type_list(
@@ -26,8 +30,8 @@ class BaseParamsDocumenter(ShapeDocumenter):
26
30
  section: Any,
27
31
  shape: Shape,
28
32
  history: Any,
29
- include: Optional[Sequence[str]] = ...,
30
- exclude: Optional[Sequence[str]] = ...,
33
+ include: Sequence[str] | None = ...,
34
+ exclude: Sequence[str] | None = ...,
31
35
  **kwargs: Any,
32
36
  ) -> None: ...
33
37
  def document_shape_type_map(
@@ -35,8 +39,8 @@ class BaseParamsDocumenter(ShapeDocumenter):
35
39
  section: Any,
36
40
  shape: Shape,
37
41
  history: Any,
38
- include: Optional[Sequence[str]] = ...,
39
- exclude: Optional[Sequence[str]] = ...,
42
+ include: Sequence[str] | None = ...,
43
+ exclude: Sequence[str] | None = ...,
40
44
  **kwargs: Any,
41
45
  ) -> None: ...
42
46
  def document_shape_type_structure(
@@ -44,9 +48,9 @@ class BaseParamsDocumenter(ShapeDocumenter):
44
48
  section: Any,
45
49
  shape: Shape,
46
50
  history: Any,
47
- include: Optional[Sequence[str]] = ...,
48
- exclude: Optional[Sequence[str]] = ...,
49
- name: Optional[str] = ...,
51
+ include: Sequence[str] | None = ...,
52
+ exclude: Sequence[str] | None = ...,
53
+ name: str | None = ...,
50
54
  **kwargs: Any,
51
55
  ) -> None: ...
52
56
 
@@ -67,7 +71,7 @@ class RequestParamsDocumenter(BaseParamsDocumenter):
67
71
  section: Any,
68
72
  shape: Shape,
69
73
  history: Any,
70
- include: Optional[Sequence[str]] = ...,
71
- exclude: Optional[Sequence[str]] = ...,
74
+ include: Sequence[str] | None = ...,
75
+ exclude: Sequence[str] | None = ...,
72
76
  **kwargs: Any,
73
77
  ) -> None: ...
@@ -1,4 +1,8 @@
1
- from typing import Any, List, Optional
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any
2
6
 
3
7
  from botocore.session import Session
4
8
 
@@ -11,5 +15,5 @@ class ServiceDocumenter:
11
15
  def client_exceptions(self, section: Any) -> None: ...
12
16
  def paginator_api(self, section: Any) -> None: ...
13
17
  def waiter_api(self, section: Any) -> None: ...
14
- def get_examples(self, service_name: str, api_version: Optional[str] = ...) -> List[str]: ...
18
+ def get_examples(self, service_name: str, api_version: str | None = ...) -> list[str]: ...
15
19
  def client_context_params(self, section: Any) -> None: ...
@@ -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.hooks import BaseEventHooks
4
8
  from botocore.model import Shape
@@ -19,6 +23,6 @@ class ShapeDocumenter:
19
23
  history: Any,
20
24
  include: Any = ...,
21
25
  exclude: Any = ...,
22
- name: Optional[str] = ...,
26
+ name: str | None = ...,
23
27
  is_required: bool = ...,
24
28
  ) -> None: ...
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any
2
6
 
3
7
  from botocore.model import OperationModel, Shape
@@ -1,9 +1,13 @@
1
- from typing import Any, List
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any
2
6
 
3
7
  from sphinx.writers.html5 import HTML5Translator as SphinxHTML5Translator # type: ignore
4
8
 
5
9
  class BotoHTML5Translator(SphinxHTML5Translator):
6
- IGNORE_IMPLICIT_HEADINGS: List[str] = ...
10
+ IGNORE_IMPLICIT_HEADINGS: list[str] = ...
7
11
  def visit_admonition(self, node: Any, name: str = ...) -> None: ...
8
12
  def is_implicit_heading(self, node: Any) -> bool: ...
9
13
  def visit_paragraph(self, node: Any) -> None: ...
@@ -1,4 +1,8 @@
1
- from typing import Any, Callable, Dict, List, NamedTuple, Optional, Type
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
5
+ from typing import Any, Callable
2
6
 
3
7
  from botocore.model import ServiceModel
4
8
 
@@ -20,14 +24,14 @@ class DocumentedShape(_DocumentedShape):
20
24
  ) -> Any: ...
21
25
 
22
26
  class AutoPopulatedParam:
23
- def __init__(self, name: str, param_description: Optional[str] = ...) -> None: ...
27
+ def __init__(self, name: str, param_description: str | None = ...) -> None: ...
24
28
  def document_auto_populated_param(
25
29
  self, event_name: str, section: Any, **kwargs: Any
26
30
  ) -> None: ...
27
31
 
28
32
  class HideParamFromOperations:
29
33
  def __init__(
30
- self, service_name: str, parameter_name: str, operation_names: List[str]
34
+ self, service_name: str, parameter_name: str, operation_names: list[str]
31
35
  ) -> None: ...
32
36
  def hide_param(self, event_name: str, section: Any, **kwargs: Any) -> None: ...
33
37
 
@@ -35,7 +39,7 @@ class AppendParamDocumentation:
35
39
  def __init__(self, parameter_name: str, doc_string: str) -> None: ...
36
40
  def append_documentation(self, event_name: str, section: Any, **kwargs: Any) -> None: ...
37
41
 
38
- _CONTROLS: Dict[str, str] = ...
42
+ _CONTROLS: dict[str, str] = ...
39
43
  _ESCAPE_CONTROLS_RE: Any = ...
40
44
  _CONTROLS_MATCH_HANDLER: Callable[..., str] = ...
41
45
 
@@ -1,3 +1,7 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from typing import Any
2
6
 
3
7
  from botocore.client import BaseClient
@@ -1,5 +1,9 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  from logging import Logger
2
- from typing import Any, Mapping, Optional, Type
6
+ from typing import Any, Mapping
3
7
 
4
8
  from botocore.awsrequest import create_request_object as create_request_object
5
9
  from botocore.exceptions import HTTPClientError as HTTPClientError
@@ -26,8 +30,8 @@ class Endpoint:
26
30
  host: str,
27
31
  endpoint_prefix: str,
28
32
  event_emitter: BaseEventHooks,
29
- response_parser_factory: Optional[Any] = ...,
30
- http_session: Optional[URLLib3Session] = ...,
33
+ response_parser_factory: Any | None = ...,
34
+ http_session: URLLib3Session | None = ...,
31
35
  ) -> None:
32
36
  self.host: str
33
37
  self.http_session: URLLib3Session
@@ -35,7 +39,7 @@ class Endpoint:
35
39
  def close(self) -> None: ...
36
40
  def make_request(self, operation_model: OperationModel, request_dict: Any) -> Any: ...
37
41
  def create_request(
38
- self, params: Mapping[str, Any], operation_model: Optional[OperationModel] = ...
42
+ self, params: Mapping[str, Any], operation_model: OperationModel | None = ...
39
43
  ) -> Any: ...
40
44
  def prepare_request(self, request: Any) -> Any: ...
41
45
 
@@ -46,13 +50,13 @@ class EndpointCreator:
46
50
  service_model: ServiceModel,
47
51
  region_name: str,
48
52
  endpoint_url: str,
49
- verify: Optional[Any] = ...,
50
- response_parser_factory: Optional[Any] = ...,
53
+ verify: Any | None = ...,
54
+ response_parser_factory: Any | None = ...,
51
55
  timeout: float = ...,
52
56
  max_pool_connections: Any = ...,
53
- http_session_cls: Type[URLLib3Session] = ...,
54
- proxies: Optional[Any] = ...,
55
- socket_options: Optional[Any] = ...,
56
- client_cert: Optional[Any] = ...,
57
- proxies_config: Optional[Any] = ...,
57
+ http_session_cls: type[URLLib3Session] = ...,
58
+ proxies: Any | None = ...,
59
+ socket_options: Any | None = ...,
60
+ client_cert: Any | None = ...,
61
+ proxies_config: Any | None = ...,
58
62
  ) -> Any: ...
@@ -1,18 +1,17 @@
1
+ """
2
+ Copyright 2024 Vlad Emelianov
3
+ """
4
+
1
5
  import logging
2
6
  from enum import Enum
3
7
  from string import Formatter
4
8
  from typing import (
5
9
  Any,
6
10
  Callable,
7
- Dict,
8
11
  Iterable,
9
- List,
10
12
  Mapping,
11
13
  NamedTuple,
12
- Optional,
13
14
  Pattern,
14
- Type,
15
- Union,
16
15
  )
17
16
 
18
17
  from botocore.compat import quote as quote
@@ -35,7 +34,7 @@ STRING_FORMATTER: Formatter = ...
35
34
 
36
35
  class RuleSetStandardLibrary:
37
36
  def __init__(self, partitions_data: Mapping[str, Any]) -> None:
38
- self.partitions_data: Dict[str, Any]
37
+ self.partitions_data: dict[str, Any]
39
38
 
40
39
  def is_func(self, argument: Any) -> bool: ...
41
40
  def is_ref(self, argument: Any) -> bool: ...
@@ -48,14 +47,14 @@ class RuleSetStandardLibrary:
48
47
  ) -> Any: ...
49
48
  def is_set(self, value: Any) -> bool: ...
50
49
  def get_attr(self, value: Mapping[str, Any], path: str) -> Any: ...
51
- def format_partition_output(self, partition: Mapping[str, Any]) -> Dict[str, Any]: ...
50
+ def format_partition_output(self, partition: Mapping[str, Any]) -> dict[str, Any]: ...
52
51
  def is_partition_match(self, region: str, partition: Mapping[str, Any]) -> bool: ...
53
- def aws_partition(self, value: str) -> Dict[str, Any]: ...
54
- def aws_parse_arn(self, value: str) -> Dict[str, Any]: ...
52
+ def aws_partition(self, value: str) -> dict[str, Any]: ...
53
+ def aws_parse_arn(self, value: str) -> dict[str, Any]: ...
55
54
  def is_valid_host_label(self, value: str, allow_subdomains: bool) -> bool: ...
56
55
  def string_equals(self, value1: str, value2: str) -> bool: ...
57
56
  def uri_encode(self, value: str) -> str: ...
58
- def parse_url(self, value: str) -> Dict[str, Any]: ...
57
+ def parse_url(self, value: str) -> dict[str, Any]: ...
59
58
  def boolean_equals(self, value1: bool, value2: bool) -> bool: ...
60
59
  def is_ascii(self, value: str) -> bool: ...
61
60
  def substring(self, value: str, start: int, stop: int, reverse: bool) -> str: ...
@@ -65,10 +64,10 @@ RuleSetStandardLibary = RuleSetStandardLibrary
65
64
 
66
65
  class BaseRule:
67
66
  def __init__(
68
- self, conditions: Iterable[Callable[..., Any]], documentation: Optional[str] = ...
67
+ self, conditions: Iterable[Callable[..., Any]], documentation: str | None = ...
69
68
  ) -> None:
70
69
  self.conditions: Iterable[Callable[..., Any]]
71
- self.documentation: Optional[str]
70
+ self.documentation: str | None
72
71
 
73
72
  def evaluate(self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary) -> Any: ...
74
73
  def evaluate_conditions(
@@ -77,25 +76,25 @@ class BaseRule:
77
76
 
78
77
  class RuleSetEndpoint(NamedTuple):
79
78
  url: str
80
- properties: Dict[str, Any]
81
- headers: Dict[str, Any]
79
+ properties: dict[str, Any]
80
+ headers: dict[str, Any]
82
81
 
83
82
  class EndpointRule(BaseRule):
84
83
  def __init__(self, endpoint: Mapping[str, Any], **kwargs: Any) -> None:
85
- self.endpoint: Dict[str, Any]
84
+ self.endpoint: dict[str, Any]
86
85
 
87
86
  def evaluate(
88
87
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
89
88
  ) -> RuleSetEndpoint: ...
90
89
  def resolve_properties(
91
90
  self,
92
- properties: Union[Mapping[str, Any], List[Any], str],
91
+ properties: Mapping[str, Any] | list[Any] | str,
93
92
  scope_vars: Mapping[str, Any],
94
93
  rule_lib: RuleSetStandardLibary,
95
- ) -> Dict[str, Any]: ...
94
+ ) -> dict[str, Any]: ...
96
95
  def resolve_headers(
97
96
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
98
- ) -> Dict[str, Any]: ...
97
+ ) -> dict[str, Any]: ...
99
98
 
100
99
  class ErrorRule(BaseRule):
101
100
  def __init__(self, error: Any, **kwargs: Any) -> None:
@@ -105,41 +104,41 @@ class ErrorRule(BaseRule):
105
104
 
106
105
  class TreeRule(BaseRule):
107
106
  def __init__(self, rules: Iterable[Mapping[str, Any]], **kwargs: Any) -> None:
108
- self.rules: Iterable[Dict[str, Any]]
107
+ self.rules: Iterable[dict[str, Any]]
109
108
 
110
109
  def evaluate(
111
110
  self, scope_vars: Mapping[str, Any], rule_lib: RuleSetStandardLibary
112
- ) -> Optional[RuleSetEndpoint]: ...
111
+ ) -> RuleSetEndpoint | None: ...
113
112
 
114
113
  class RuleCreator:
115
- endpoint: Type[EndpointRule]
116
- error: Type[ErrorRule]
117
- tree: Type[TreeRule]
114
+ endpoint: type[EndpointRule]
115
+ error: type[ErrorRule]
116
+ tree: type[TreeRule]
118
117
  @classmethod
119
118
  def create(cls, **kwargs: Any) -> BaseRule: ...
120
119
 
121
120
  class ParameterType(Enum):
122
- string: Type[str]
123
- boolean: Type[bool]
121
+ string: type[str]
122
+ boolean: type[bool]
124
123
 
125
124
  class ParameterDefinition:
126
125
  def __init__(
127
126
  self,
128
127
  name: str,
129
128
  parameter_type: ParameterType,
130
- documentation: Optional[str] = ...,
131
- builtIn: Optional[bool] = ...,
132
- default: Optional[bool] = ...,
133
- required: Optional[bool] = ...,
134
- deprecated: Optional[bool] = ...,
129
+ documentation: str | None = ...,
130
+ builtIn: bool | None = ...,
131
+ default: bool | None = ...,
132
+ required: bool | None = ...,
133
+ deprecated: bool | None = ...,
135
134
  ) -> None:
136
135
  self.name: str
137
136
  self.parameter_type: ParameterType
138
- self.documentation: Optional[str]
139
- self.built_in: Optional[bool]
140
- self.default: Optional[bool]
141
- self.required: Optional[bool]
142
- self.deprecated: Optional[bool]
137
+ self.documentation: str | None
138
+ self.built_in: bool | None
139
+ self.default: bool | None
140
+ self.required: bool | None
141
+ self.deprecated: bool | None
143
142
 
144
143
  def validate_input(self, value: Any) -> None: ...
145
144
  def process_input(self, value: Any) -> Any: ...
@@ -151,13 +150,13 @@ class RuleSet:
151
150
  parameters: Mapping[str, Any],
152
151
  rules: Iterable[Mapping[str, Any]],
153
152
  partitions: Any,
154
- documentation: Optional[str] = ...,
153
+ documentation: str | None = ...,
155
154
  ) -> None:
156
155
  self.version: str
157
- self.parameters: Dict[str, Any]
158
- self.rules: List[BaseRule]
156
+ self.parameters: dict[str, Any]
157
+ self.rules: list[BaseRule]
159
158
  self.rule_lib: RuleSetStandardLibary
160
- self.documentation: Optional[str]
159
+ self.documentation: str | None
161
160
 
162
161
  def process_input_parameters(self, input_params: Mapping[str, Any]) -> None: ...
163
162
  def evaluate(self, input_parameters: Mapping[str, Any]) -> Any: ...