ominfra 0.0.0.dev208__tar.gz → 0.0.0.dev210__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {ominfra-0.0.0.dev208/ominfra.egg-info → ominfra-0.0.0.dev210}/PKG-INFO +3 -4
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/__about__.py +0 -1
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/main.py +0 -1
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/base.py +44 -10
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/gen/gen.py +45 -5
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/ec2.py +1072 -946
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/lambda_.py +111 -102
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/rds.py +321 -293
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/s3.py +197 -190
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/main.py +0 -1
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/scripts/manage.py +19 -3
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/main.py +0 -1
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210/ominfra.egg-info}/PKG-INFO +3 -4
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra.egg-info/requires.txt +2 -3
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/pyproject.toml +3 -4
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/LICENSE +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/MANIFEST.in +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/README.rst +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/.manifests.json +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/auth.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/cli.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/dataclasses.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/instancetypes/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/instancetypes/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/instancetypes/cache.json.gz +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/instancetypes/cache.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/instancetypes/cli.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/logs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/metadata.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/gen/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/gen/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/gen/cli.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/aws/models/services/services.toml +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/gcp/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/clouds/gcp/auth.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/commands/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/commands/runners.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/commands/ssh.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/journald/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/journald/fields.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/journald/genmessages.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/journald/messages.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/journald/tailer.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/bootstrap.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/bootstrap_.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/base.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/injection.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/local.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/marshal.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/ping.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/subprocess.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/commands/types.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/config.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/apps.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/commands.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/conf/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/conf/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/conf/manager.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/conf/specs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/config.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/deploy.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/git.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/injection.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/interp.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/nginx.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/manager.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/owners.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/paths.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/specs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/paths/types.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/specs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/systemd.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/tags.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/tmp.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/types.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/deploy/venvs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/marshal.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/_main.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/channel.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/config.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/connection.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/execution.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/payload.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/remote/spawning.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/commands.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/config.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/packages.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/system/platforms.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/bestpython.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/bestpython.sh +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/connection.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/manage/targets/targets.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/pyremote.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/scripts/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/scripts/journald2aws.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/scripts/supervisor.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/LICENSE.txt +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/__main__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/configs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/dispatchers.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/dispatchersimpl.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/events.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/exceptions.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/groups.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/groupsimpl.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/http.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/inject.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/io.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/pipes.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/privileges.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/process.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/processimpl.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/setup.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/setupimpl.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/signals.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/spawning.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/spawningimpl.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/states.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/supervisor.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/types.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/collections.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/diag.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/fds.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/fs.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/os.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/ostypes.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/signals.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/strings.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/supervisor/utils/users.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/systemd.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/tailscale/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/tailscale/api.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/tailscale/cli.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/threadworkers.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/tools/__init__.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra/tools/listresources.py +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra.egg-info/SOURCES.txt +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra.egg-info/dependency_links.txt +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra.egg-info/entry_points.txt +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/ominfra.egg-info/top_level.txt +0 -0
- {ominfra-0.0.0.dev208 → ominfra-0.0.0.dev210}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev210
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,9 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omdev==0.0.0.
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
-
Requires-Dist: omserv==0.0.0.dev208
|
15
|
+
Requires-Dist: omdev==0.0.0.dev210
|
16
|
+
Requires-Dist: omlish==0.0.0.dev210
|
18
17
|
Provides-Extra: all
|
19
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
20
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import abc
|
1
2
|
import typing as ta
|
2
3
|
|
3
4
|
from omlish import cached
|
@@ -16,10 +17,33 @@ Timestamp = ta.NewType('Timestamp', str)
|
|
16
17
|
##
|
17
18
|
|
18
19
|
|
19
|
-
|
20
|
+
@dc.dataclass(frozen=True)
|
21
|
+
class Tag:
|
22
|
+
key: str
|
23
|
+
value: str
|
24
|
+
|
25
|
+
|
26
|
+
TagList: ta.TypeAlias = ta.Sequence[Tag]
|
27
|
+
|
28
|
+
|
29
|
+
##
|
30
|
+
|
31
|
+
|
32
|
+
class ValueType(abc.ABC): # noqa
|
20
33
|
pass
|
21
34
|
|
22
35
|
|
36
|
+
@dc.dataclass(frozen=True)
|
37
|
+
class ListValueType(ValueType):
|
38
|
+
e: type
|
39
|
+
|
40
|
+
|
41
|
+
@dc.dataclass(frozen=True)
|
42
|
+
class MapValueType(ValueType):
|
43
|
+
k: type
|
44
|
+
v: type
|
45
|
+
|
46
|
+
|
23
47
|
##
|
24
48
|
|
25
49
|
|
@@ -71,27 +95,27 @@ class ShapeInfo:
|
|
71
95
|
|
72
96
|
#
|
73
97
|
|
74
|
-
@cached.
|
98
|
+
@cached.property
|
75
99
|
def fields(self) -> ta.Sequence[dc.Field]:
|
76
100
|
check.state(dc.is_immediate_dataclass(self._cls))
|
77
101
|
fls = dc.fields(self._cls)
|
78
102
|
return fls # noqa
|
79
103
|
|
80
|
-
@cached.
|
104
|
+
@cached.property
|
81
105
|
def fields_by_name(self) -> ta.Mapping[str, dc.Field]:
|
82
|
-
return col.make_map_by(lambda fl: fl.name, self.fields
|
106
|
+
return col.make_map_by(lambda fl: fl.name, self.fields, strict=True)
|
83
107
|
|
84
|
-
@cached.
|
108
|
+
@cached.property
|
85
109
|
def fields_by_member_name(self) -> ta.Mapping[str, dc.Field]:
|
86
110
|
return col.make_map(
|
87
|
-
[(n, f) for f in self.fields
|
111
|
+
[(n, f) for f in self.fields if (n := f.metadata.get(MEMBER_NAME)) is not None],
|
88
112
|
strict=True,
|
89
113
|
)
|
90
114
|
|
91
|
-
@cached.
|
115
|
+
@cached.property
|
92
116
|
def fields_by_serialization_name(self) -> ta.Mapping[str, dc.Field]:
|
93
117
|
l = []
|
94
|
-
for f in self.fields
|
118
|
+
for f in self.fields:
|
95
119
|
if sn := f.metadata.get(SERIALIZATION_NAME):
|
96
120
|
l.append((sn, f))
|
97
121
|
elif mn := f.metadata.get(MEMBER_NAME):
|
@@ -99,9 +123,9 @@ class ShapeInfo:
|
|
99
123
|
return col.make_map(l, strict=True)
|
100
124
|
|
101
125
|
|
102
|
-
@dc.dataclass(frozen=True)
|
126
|
+
@dc.dataclass(frozen=True, kw_only=True)
|
103
127
|
class Shape:
|
104
|
-
__shape__: ShapeInfo
|
128
|
+
__shape__: ta.ClassVar[ShapeInfo]
|
105
129
|
|
106
130
|
def __init_subclass__(
|
107
131
|
cls,
|
@@ -132,10 +156,18 @@ class SERIALIZATION_NAME(lang.Marker): # noqa
|
|
132
156
|
pass
|
133
157
|
|
134
158
|
|
159
|
+
class VALUE_TYPE(lang.Marker): # noqa
|
160
|
+
pass
|
161
|
+
|
162
|
+
|
163
|
+
#
|
164
|
+
|
165
|
+
|
135
166
|
def field_metadata(
|
136
167
|
*,
|
137
168
|
member_name: str | None = None,
|
138
169
|
serialization_name: str | None = None,
|
170
|
+
value_type: ValueType | None = None,
|
139
171
|
**kwargs: ta.Any,
|
140
172
|
) -> dict[ta.Any, ta.Any]:
|
141
173
|
md = {**common_metadata(**kwargs)}
|
@@ -144,6 +176,8 @@ def field_metadata(
|
|
144
176
|
md[MEMBER_NAME] = member_name
|
145
177
|
if serialization_name is not None:
|
146
178
|
md[SERIALIZATION_NAME] = serialization_name
|
179
|
+
if value_type is not None:
|
180
|
+
md[VALUE_TYPE] = value_type
|
147
181
|
|
148
182
|
return md
|
149
183
|
|
@@ -164,6 +164,7 @@ class ModelGen:
|
|
164
164
|
'DateTime': '_base.DateTime',
|
165
165
|
'MillisecondDateTime': '_base.MillisecondDateTime',
|
166
166
|
|
167
|
+
'Tag': '_base.Tag',
|
167
168
|
'TagList': '_base.TagList',
|
168
169
|
}
|
169
170
|
|
@@ -303,6 +304,8 @@ class ModelGen:
|
|
303
304
|
san_name = self.sanitize_global_name(shape.name, upper=True)
|
304
305
|
|
305
306
|
if isinstance(shape, botocore.model.StructureShape):
|
307
|
+
rms = frozenset(shape.required_members or [])
|
308
|
+
|
306
309
|
lines: list[str] = []
|
307
310
|
|
308
311
|
mds = [
|
@@ -310,7 +313,7 @@ class ModelGen:
|
|
310
313
|
]
|
311
314
|
|
312
315
|
lines.extend([
|
313
|
-
'@_dc.dataclass(frozen=True)',
|
316
|
+
'@_dc.dataclass(frozen=True, kw_only=True)',
|
314
317
|
f'class {san_name}(',
|
315
318
|
' _base.Shape,',
|
316
319
|
*[f' {dl},' for dl in mds],
|
@@ -320,27 +323,64 @@ class ModelGen:
|
|
320
323
|
if not shape.members:
|
321
324
|
lines.append(' pass')
|
322
325
|
|
326
|
+
ms: botocore.model.Shape
|
323
327
|
for i, (mn, ms) in enumerate(shape.members.items()):
|
324
|
-
if i:
|
325
|
-
lines.append('')
|
326
|
-
fn = self.sanitize_local_name(self.demangle_name(mn))
|
327
328
|
mds = [
|
328
329
|
f'member_name={mn!r}',
|
329
330
|
]
|
331
|
+
|
330
332
|
if msn := ms.serialization.get('name'):
|
331
333
|
mds.append(f'serialization_name={msn!r}')
|
334
|
+
|
335
|
+
if isinstance(ms, botocore.model.MapShape):
|
336
|
+
ka = self.get_type_ann(
|
337
|
+
ms.key.name,
|
338
|
+
unquoted_names=unquoted_names,
|
339
|
+
) or ms.key.name
|
340
|
+
va = self.get_type_ann(
|
341
|
+
ms.value.name,
|
342
|
+
unquoted_names=unquoted_names,
|
343
|
+
) or ms.value.name
|
344
|
+
mds.append(f'value_type=_base.MapValueType({ka}, {va})')
|
345
|
+
|
346
|
+
elif isinstance(ms, botocore.model.ListShape):
|
347
|
+
ea = self.get_type_ann(
|
348
|
+
ms.member.name,
|
349
|
+
unquoted_names=unquoted_names,
|
350
|
+
) or ms.member.name
|
351
|
+
mds.append(f'value_type=_base.ListValueType({ea})')
|
352
|
+
|
332
353
|
mds.append(f'shape_name={ms.name!r}')
|
354
|
+
|
333
355
|
ma = self.get_type_ann(
|
334
356
|
ms.name,
|
335
357
|
unquoted_names=unquoted_names,
|
336
358
|
)
|
359
|
+
|
360
|
+
#
|
361
|
+
|
362
|
+
if i:
|
363
|
+
lines.append('')
|
364
|
+
|
365
|
+
fr = mn in rms
|
366
|
+
fa = ma or ms.name
|
367
|
+
if fr:
|
368
|
+
fd = ''
|
369
|
+
else:
|
370
|
+
fa += ' | None'
|
371
|
+
fd = 'default=None, '
|
372
|
+
|
373
|
+
fn = self.sanitize_local_name(self.demangle_name(mn))
|
374
|
+
|
337
375
|
fls = [
|
338
|
-
f'{fn}: {
|
376
|
+
f'{fn}: {fa} = _dc.field({fd}metadata=_base.field_metadata(',
|
339
377
|
*[f' {dl},' for dl in mds],
|
340
378
|
'))',
|
341
379
|
]
|
380
|
+
|
342
381
|
if ma is None:
|
343
382
|
fls = ['# ' + fl for fl in fls]
|
383
|
+
|
344
384
|
lines.append('\n'.join(' ' + fl for fl in fls))
|
345
385
|
|
346
386
|
return self.ShapeSrc(
|