aws-sdk-lambda 0.9.0__tar.gz → 0.11.0__tar.gz
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.
- aws_sdk_lambda-0.11.0/.changes/0.10.0.json +8 -0
- aws_sdk_lambda-0.11.0/.changes/0.11.0.json +20 -0
- aws_sdk_lambda-0.11.0/CHANGELOG.md +33 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/PKG-INFO +5 -3
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/pyproject.toml +8 -3
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/scripts/docs/generate_doc_stubs.py +85 -13
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/__init__.py +1 -1
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/_private/schemas.py +321 -9
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/client.py +2514 -524
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/config.py +113 -111
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/models.py +459 -9
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/user_agent.py +2 -2
- aws_sdk_lambda-0.9.0/CHANGELOG.md +0 -16
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/.changes/0.8.0.json +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/.changes/0.9.0.json +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/.gitignore +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/LICENSE +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/Makefile +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/NOTICE +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/README.md +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/docs/README.md +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/docs/index.md +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/docs/stylesheets/extra.css +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/_private/__init__.py +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/src/aws_sdk_lambda/auth.py +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/tests/__init__.py +0 -0
- /aws_sdk_lambda-0.9.0/tests/test_protocol.py → /aws_sdk_lambda-0.11.0/tests/test_restjson_protocol.py +0 -0
- {aws_sdk_lambda-0.9.0 → aws_sdk_lambda-0.11.0}/zensical.toml +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"changes": [
|
|
3
|
+
{
|
|
4
|
+
"type": "api-change",
|
|
5
|
+
"description": "Adds support for full JSON resource-based policies, enabling customers to create, retrieve, update, and delete function resource policies as complete JSON documents."
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"type": "enhancement",
|
|
9
|
+
"description": "Re-generated with smithy-python 0.5.0"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "dependency",
|
|
13
|
+
"description": "Bump `smithy-aws-core` from `~=0.10.0` to `~=0.11.0`."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "dependency",
|
|
17
|
+
"description": "Bump `smithy-http` from `~=0.4.0` to `~=0.5.0`."
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.11.0
|
|
4
|
+
|
|
5
|
+
### API Changes
|
|
6
|
+
* Adds support for full JSON resource-based policies, enabling customers to create, retrieve, update, and delete function resource policies as complete JSON documents.
|
|
7
|
+
|
|
8
|
+
### Enhancements
|
|
9
|
+
* Re-generated with smithy-python 0.5.0
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
* Bump `smithy-aws-core` from `~=0.10.0` to `~=0.11.0`.
|
|
13
|
+
* Bump `smithy-http` from `~=0.4.0` to `~=0.5.0`.
|
|
14
|
+
|
|
15
|
+
## v0.10.0
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
* Bump `smithy-aws-core` from `~=0.9.0` to `~=0.10.0`.
|
|
19
|
+
|
|
20
|
+
## v0.9.0
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
* Bump `smithy-core` from `~=0.7.0` to `~=0.8.0`.
|
|
24
|
+
* Bump `smithy-aws-core` from `~=0.8.0` to `~=0.9.0`.
|
|
25
|
+
|
|
26
|
+
## v0.8.0
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
* Initial client release with support for current AWS Lambda operations.
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
* Bump `smithy-aws-core` from `~=0.7.0` to `~=0.8.0`.
|
|
33
|
+
* Bump `smithy-core` from `~=0.6.0` to `~=0.7.0`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: aws_sdk_lambda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: aws_sdk_lambda client
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -18,9 +18,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
|
-
Requires-Dist: smithy-aws-core[eventstream,json]~=0.
|
|
21
|
+
Requires-Dist: smithy-aws-core[eventstream,json]~=0.11.0
|
|
22
22
|
Requires-Dist: smithy-core~=0.8.0
|
|
23
|
-
Requires-Dist: smithy-http[
|
|
23
|
+
Requires-Dist: smithy-http[aiohttp]~=0.5.0
|
|
24
|
+
Provides-Extra: awscrt
|
|
25
|
+
Requires-Dist: smithy-http[awscrt]~=0.5.0; extra == 'awscrt'
|
|
24
26
|
Description-Content-Type: text/markdown
|
|
25
27
|
|
|
26
28
|
## AWS Lambda Client
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "aws_sdk_lambda"
|
|
5
|
-
version = "0.
|
|
5
|
+
version = "0.11.0"
|
|
6
6
|
description = "aws_sdk_lambda client"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
requires-python = ">=3.12"
|
|
@@ -23,9 +23,14 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
|
|
25
25
|
dependencies = [
|
|
26
|
-
"smithy_aws_core[eventstream, json]~=0.
|
|
26
|
+
"smithy_aws_core[eventstream, json]~=0.11.0",
|
|
27
27
|
"smithy_core~=0.8.0",
|
|
28
|
-
"smithy_http[
|
|
28
|
+
"smithy_http[aiohttp]~=0.5.0"
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
awscrt = [
|
|
33
|
+
"smithy_http[awscrt]~=0.5.0"
|
|
29
34
|
]
|
|
30
35
|
|
|
31
36
|
[dependency-groups]
|
|
@@ -8,6 +8,7 @@ for the client, operations, models (structures, unions, enums), and errors.
|
|
|
8
8
|
|
|
9
9
|
import argparse
|
|
10
10
|
import logging
|
|
11
|
+
import re
|
|
11
12
|
import sys
|
|
12
13
|
from collections.abc import Sequence
|
|
13
14
|
from dataclasses import dataclass
|
|
@@ -39,6 +40,7 @@ logger = logging.getLogger("generate_doc_stubs")
|
|
|
39
40
|
|
|
40
41
|
ENUM_BASE_CLASSES = ("StrEnum", "IntEnum")
|
|
41
42
|
ERROR_BASE_CLASSES = ("ServiceError", "ModeledError")
|
|
43
|
+
CLIENT_METHOD_NAMES = ("close",)
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
class StreamType(Enum):
|
|
@@ -89,6 +91,14 @@ class OperationInfo:
|
|
|
89
91
|
event_output_type: str | None # For output/duplex streams
|
|
90
92
|
|
|
91
93
|
|
|
94
|
+
@dataclass
|
|
95
|
+
class ClientMethodInfo:
|
|
96
|
+
"""Information about a non-operation client method."""
|
|
97
|
+
|
|
98
|
+
name: str
|
|
99
|
+
module_path: str
|
|
100
|
+
|
|
101
|
+
|
|
92
102
|
@dataclass
|
|
93
103
|
class ModelsInfo:
|
|
94
104
|
"""Information about all modeled types."""
|
|
@@ -108,6 +118,7 @@ class ClientInfo:
|
|
|
108
118
|
package_name: str # e.g., "aws_sdk_bedrock_runtime"
|
|
109
119
|
config: TypeInfo
|
|
110
120
|
plugin: TypeInfo
|
|
121
|
+
client_methods: list[ClientMethodInfo]
|
|
111
122
|
operations: list[OperationInfo]
|
|
112
123
|
models: ModelsInfo
|
|
113
124
|
|
|
@@ -115,19 +126,43 @@ class ClientInfo:
|
|
|
115
126
|
class DocStubGenerator:
|
|
116
127
|
"""Generate markdown API Reference stubs for AWS SDK for Python clients."""
|
|
117
128
|
|
|
118
|
-
def __init__(self, client_dir: Path, output_dir: Path) -> None:
|
|
129
|
+
def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None:
|
|
119
130
|
"""
|
|
120
131
|
Initialize the documentation generator.
|
|
121
132
|
|
|
122
133
|
Args:
|
|
123
134
|
client_dir: Path to the client source directory
|
|
124
135
|
output_dir: Path to the output directory for generated doc stubs
|
|
136
|
+
service_name: Display name for the service (e.g. the Smithy sdkId
|
|
137
|
+
"SNS"). When omitted, falls back to a title-cased derivation of
|
|
138
|
+
the package name, which does not preserve acronym casing.
|
|
125
139
|
"""
|
|
126
140
|
self.client_dir = client_dir
|
|
127
141
|
self.output_dir = output_dir
|
|
128
|
-
#
|
|
129
|
-
# (
|
|
130
|
-
|
|
142
|
+
# Use the explicit override, then the sdkId from the package, then
|
|
143
|
+
# fall back to a title-cased package name (does not keep acronym
|
|
144
|
+
# casing, so "sns" becomes "Sns").
|
|
145
|
+
self.service_name = (
|
|
146
|
+
service_name
|
|
147
|
+
or self._sdk_id_from_package(client_dir)
|
|
148
|
+
or client_dir.name.replace("aws_sdk_", "").replace("_", " ").title()
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
@staticmethod
|
|
152
|
+
def _sdk_id_from_package(client_dir: Path) -> str | None:
|
|
153
|
+
"""
|
|
154
|
+
Read the authoritative service name (Smithy sdkId) from the package.
|
|
155
|
+
|
|
156
|
+
The generated ``_private/schemas.py`` carries the ``aws.api#service``
|
|
157
|
+
trait's ``sdkId`` (e.g. "SNS"), the same field the sidebar navigation
|
|
158
|
+
uses, so it keeps acronym casing that the package name does not.
|
|
159
|
+
Returns None if the file or value is absent.
|
|
160
|
+
"""
|
|
161
|
+
schemas = client_dir / "_private" / "schemas.py"
|
|
162
|
+
if not schemas.is_file():
|
|
163
|
+
return None
|
|
164
|
+
match = re.search(r'"sdkId":\s*"([^"]+)"', schemas.read_text())
|
|
165
|
+
return match.group(1) if match else None
|
|
131
166
|
|
|
132
167
|
def generate(self) -> bool:
|
|
133
168
|
"""
|
|
@@ -166,19 +201,24 @@ class DocStubGenerator:
|
|
|
166
201
|
if not client_class:
|
|
167
202
|
raise ValueError(f"No class ending with 'Client' found in {package_name}.client")
|
|
168
203
|
|
|
169
|
-
config_class =
|
|
204
|
+
config_class = self._find_class_with_suffix(config_module, "Config")
|
|
205
|
+
if not config_class:
|
|
206
|
+
raise ValueError(f"No class ending with 'Config' found in {package_name}.config")
|
|
207
|
+
|
|
170
208
|
plugin_alias = config_module.members.get("Plugin")
|
|
171
|
-
if not
|
|
172
|
-
raise ValueError(f"Missing
|
|
209
|
+
if not plugin_alias:
|
|
210
|
+
raise ValueError(f"Missing Plugin in {package_name}.config")
|
|
173
211
|
|
|
174
212
|
config = TypeInfo(name=config_class.name, module_path=config_class.path)
|
|
175
213
|
plugin = TypeInfo(name=plugin_alias.name, module_path=plugin_alias.path)
|
|
176
214
|
|
|
215
|
+
client_methods = self._extract_client_methods(client_class)
|
|
177
216
|
operations = self._extract_operations(client_class)
|
|
178
217
|
models = self._extract_models(models_module, operations)
|
|
179
218
|
|
|
180
219
|
logger.info(
|
|
181
|
-
f"Analyzed {client_class.name}: {len(
|
|
220
|
+
f"Analyzed {client_class.name}: {len(client_methods)} client methods, "
|
|
221
|
+
f"{len(operations)} operations, "
|
|
182
222
|
f"{len(models.structures)} structures, {len(models.errors)} errors, "
|
|
183
223
|
f"{len(models.unions)} unions, {len(models.enums)} enums"
|
|
184
224
|
)
|
|
@@ -189,13 +229,18 @@ class DocStubGenerator:
|
|
|
189
229
|
package_name=package_name,
|
|
190
230
|
config=config,
|
|
191
231
|
plugin=plugin,
|
|
232
|
+
client_methods=client_methods,
|
|
192
233
|
operations=operations,
|
|
193
234
|
models=models,
|
|
194
235
|
)
|
|
195
236
|
|
|
196
237
|
def _find_class_with_suffix(self, module: Module, suffix: str) -> Class | None:
|
|
197
|
-
"""Find the class in the module with a matching suffix."""
|
|
238
|
+
"""Find the class defined in the module with a matching suffix."""
|
|
198
239
|
for cls in module.classes.values():
|
|
240
|
+
# Skip imported classes so a same-package import (e.g. a *Config
|
|
241
|
+
# class re-exported from config.py) can't shadow the defined one.
|
|
242
|
+
if cls.is_imported:
|
|
243
|
+
continue
|
|
199
244
|
if cls.name.endswith(suffix):
|
|
200
245
|
return cls
|
|
201
246
|
return None
|
|
@@ -204,11 +249,24 @@ class DocStubGenerator:
|
|
|
204
249
|
"""Extract operation information from client class."""
|
|
205
250
|
operations = []
|
|
206
251
|
for op in client_class.functions.values():
|
|
207
|
-
if
|
|
252
|
+
if (
|
|
253
|
+
op.is_private
|
|
254
|
+
or op.is_init_method
|
|
255
|
+
or op.is_special
|
|
256
|
+
or op.name in CLIENT_METHOD_NAMES
|
|
257
|
+
):
|
|
208
258
|
continue
|
|
209
259
|
operations.append(self._analyze_operation(op))
|
|
210
260
|
return operations
|
|
211
261
|
|
|
262
|
+
def _extract_client_methods(self, client_class: Class) -> list[ClientMethodInfo]:
|
|
263
|
+
"""Extract public client methods that are not service operations."""
|
|
264
|
+
return [
|
|
265
|
+
ClientMethodInfo(name=method.name, module_path=method.path)
|
|
266
|
+
for method in client_class.functions.values()
|
|
267
|
+
if not method.is_private and method.name in CLIENT_METHOD_NAMES
|
|
268
|
+
]
|
|
269
|
+
|
|
212
270
|
def _analyze_operation(self, operation: Function) -> OperationInfo:
|
|
213
271
|
"""Analyze an operation method to extract information."""
|
|
214
272
|
stream_type = None
|
|
@@ -239,7 +297,8 @@ class DocStubGenerator:
|
|
|
239
297
|
event_output_type = stream_args[idx].canonical_name
|
|
240
298
|
|
|
241
299
|
output_info = TypeInfo(
|
|
242
|
-
name=stream_args[-1].canonical_name,
|
|
300
|
+
name=stream_args[-1].canonical_name,
|
|
301
|
+
module_path=stream_args[-1].canonical_path,
|
|
243
302
|
)
|
|
244
303
|
else:
|
|
245
304
|
output_info = TypeInfo(name=output_type, module_path=returns.canonical_path)
|
|
@@ -402,6 +461,9 @@ class DocStubGenerator:
|
|
|
402
461
|
"",
|
|
403
462
|
]
|
|
404
463
|
|
|
464
|
+
for method in sorted(client_info.client_methods, key=lambda x: x.name):
|
|
465
|
+
lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""])
|
|
466
|
+
|
|
405
467
|
# Operations section
|
|
406
468
|
if client_info.operations:
|
|
407
469
|
lines.append("## Operations")
|
|
@@ -607,7 +669,11 @@ def main() -> int:
|
|
|
607
669
|
description="Generate API documentation stubs for AWS SDK Python client."
|
|
608
670
|
)
|
|
609
671
|
parser.add_argument(
|
|
610
|
-
"-c",
|
|
672
|
+
"-c",
|
|
673
|
+
"--client-dir",
|
|
674
|
+
type=Path,
|
|
675
|
+
required=True,
|
|
676
|
+
help="Path to the client source package",
|
|
611
677
|
)
|
|
612
678
|
parser.add_argument(
|
|
613
679
|
"-o",
|
|
@@ -616,6 +682,12 @@ def main() -> int:
|
|
|
616
682
|
required=True,
|
|
617
683
|
help="Output directory for generated doc stubs",
|
|
618
684
|
)
|
|
685
|
+
parser.add_argument(
|
|
686
|
+
"-s",
|
|
687
|
+
"--service-name",
|
|
688
|
+
default=None,
|
|
689
|
+
help="Display name for the service (Smithy sdkId, e.g. 'SNS')",
|
|
690
|
+
)
|
|
619
691
|
|
|
620
692
|
args = parser.parse_args()
|
|
621
693
|
client_dir = args.client_dir.resolve()
|
|
@@ -626,7 +698,7 @@ def main() -> int:
|
|
|
626
698
|
return 1
|
|
627
699
|
|
|
628
700
|
try:
|
|
629
|
-
generator = DocStubGenerator(client_dir, output_dir)
|
|
701
|
+
generator = DocStubGenerator(client_dir, output_dir, args.service_name)
|
|
630
702
|
success = generator.generate()
|
|
631
703
|
return 0 if success else 1
|
|
632
704
|
except Exception as e:
|